From 2040f865c189be7cc473df037f7ca1c040a0d978 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 17 Jun 2025 15:39:58 +0200 Subject: [PATCH 01/68] custom ai excutor --- examples/09-ai/01-minimal/App.tsx | 10 +- packages/xl-ai/src/AIExtension.ts | 25 +++- packages/xl-ai/src/api/LLMRequest.ts | 110 ++++++++++-------- packages/xl-ai/src/api/LLMResponse.ts | 43 +++++++ packages/xl-ai/src/api/index.ts | 1 + .../src/streamTool/callLLMWithStreamTools.ts | 40 +++++++ 6 files changed, 176 insertions(+), 53 deletions(-) diff --git a/examples/09-ai/01-minimal/App.tsx b/examples/09-ai/01-minimal/App.tsx index 3305386186..e793ba789f 100644 --- a/examples/09-ai/01-minimal/App.tsx +++ b/examples/09-ai/01-minimal/App.tsx @@ -7,9 +7,9 @@ import "@blocknote/mantine/style.css"; import { FormattingToolbar, FormattingToolbarController, - SuggestionMenuController, getDefaultReactSlashMenuItems, getFormattingToolbarItems, + SuggestionMenuController, useCreateBlockNote, } from "@blocknote/react"; import { @@ -64,6 +64,14 @@ export default function App() { extensions: [ createAIExtension({ model, + /* + executor: (opts) => { + // fetch data + const resp = await fetch(opts) + // process to stream tool calls + const streamToolCalls = await yourLogicToConvertRespToStreamToolCalls(opts); + return LLMResponse.fromArray(opts.messages, opts.streamTools, streamToolCalls); + },*/ }), ], // We set some initial content for demo purposes diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index e4ba5d6840..9922e23c7f 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -9,15 +9,19 @@ import { suggestChanges, } from "@blocknote/prosemirror-suggest-changes"; import { APICallError, LanguageModel, RetryError } from "ai"; +import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { doLLMRequest, LLMRequestOptions } from "./api/LLMRequest.js"; +import { + doLLMRequest, + ExecuteLLMRequestOptions, + LLMRequestOptions, +} from "./api/LLMRequest.js"; import { LLMResponse } from "./api/LLMResponse.js"; import { PromptBuilder } from "./api/formats/PromptBuilder.js"; import { LLMFormat, llmFormats } from "./api/index.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; -import { Fragment, Slice } from "prosemirror-model"; type MakeOptional = Omit & Partial>; @@ -81,6 +85,13 @@ type GlobalLLMRequestOptions = { * @default the default prompt builder for the selected {@link dataFormat} */ promptBuilder?: PromptBuilder; + + /** + * Customize how your LLM backend is called. + * Implement this function if you want to call a backend that is not compatible with + * the Vercel AI SDK + */ + executor?: (opts: ExecuteLLMRequestOptions) => Promise; }; const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`); @@ -112,7 +123,10 @@ export class AIExtension extends BlockNoteExtension { public readonly options: ReturnType< ReturnType< typeof createStore< - MakeOptional, "promptBuilder"> + MakeOptional< + Required, + "promptBuilder" | "executor" + > > > >; @@ -134,7 +148,10 @@ export class AIExtension extends BlockNoteExtension { super(); this.options = createStore< - MakeOptional, "promptBuilder"> + MakeOptional< + Required, + "promptBuilder" | "executor" + > >()((_set) => ({ dataFormat: llmFormats.html, stream: true, diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index c11a19d62b..35e8c3825d 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,23 +1,40 @@ import { BlockNoteEditor } from "@blocknote/core"; import { CoreMessage, generateObject, LanguageModelV1, streamObject } from "ai"; -import { - generateOperations, - streamOperations, -} from "../streamTool/callLLMWithStreamTools.js"; +import { createAISDKLLMRequestExecutor } from "../streamTool/callLLMWithStreamTools.js"; +import { StreamTool } from "../streamTool/streamTool.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; import type { PromptBuilder } from "./formats/PromptBuilder.js"; import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; import { LLMFormat } from "./index.js"; +type MakeOptional = Omit & Partial>; + +export type ExecuteLLMRequestOptions = { + messages: CoreMessage[]; + streamTools: StreamTool[]; + llmRequestOptions: MakeOptional; + onStart?: () => void; +}; + export type LLMRequestOptions = { /** * The language model to use for the LLM call (AI SDK) * * (when invoking `callLLM` via the `AIExtension` this will default to the * model set in the `AIExtension` options) + * + * Note: perhaps we want to remove this */ - model: LanguageModelV1; + model?: LanguageModelV1; + + /** + * Customize how your LLM backend is called. + * Implement this function if you want to call a backend that is not compatible with + * the Vercel AI SDK + */ + executor?: (opts: ExecuteLLMRequestOptions) => Promise; + /** * The user prompt to use for the LLM call */ @@ -43,12 +60,6 @@ export type LLMRequestOptions = { * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) */ promptBuilder?: PromptBuilder; - /** - * The maximum number of retries for the LLM call - * - * @default 2 - */ - maxRetries?: number; /** * Whether to use the editor selection for the LLM call * @@ -68,15 +79,6 @@ export type LLMRequestOptions = { /** Enable the delete tool (default: true) */ delete?: boolean; }; - /** - * Whether to stream the LLM response or not - * - * When streaming, we use the AI SDK `streamObject` function, - * otherwise, we use the AI SDK `generateObject` function. - * - * @default true - */ - stream?: boolean; /** * If the user's cursor is in an empty paragraph, automatically delete it when the AI * is starting to write. @@ -102,6 +104,26 @@ export type LLMRequestOptions = { * @default true */ withDelays?: boolean; + + // The settings below might make more sense to be part of the executor + + /** + * Whether to stream the LLM response or not + * + * When streaming, we use the AI SDK `streamObject` function, + * otherwise, we use the AI SDK `generateObject` function. + * + * @default true + */ + stream?: boolean; + + /** + * The maximum number of retries for the LLM call + * + * @default 2 + */ + maxRetries?: number; + /** * Additional options to pass to the AI SDK `generateObject` function * (only used when `stream` is `false`) @@ -217,34 +239,26 @@ export async function doLLMRequest( opts.onBlockUpdate, ); - let response: - | Awaited>> - | Awaited>>; - - if (stream) { - response = await streamOperations( - streamTools, - { - messages, - ...rest, - }, - () => { - if (deleteCursorBlock) { - editor.removeBlocks([deleteCursorBlock]); - } - onStart?.(); - }, - ); - } else { - response = await generateOperations(streamTools, { - messages, - ...rest, - }); - if (deleteCursorBlock) { - editor.removeBlocks([deleteCursorBlock]); + let executor = opts.executor; + if (!executor) { + if (!opts.model) { + throw new Error("model is required when no executor is provided"); } - onStart?.(); + executor = createAISDKLLMRequestExecutor({ model: opts.model }); } - - return new LLMResponse(messages, response, streamTools); + return executor({ + onStart: () => { + if (deleteCursorBlock) { + editor.removeBlocks([deleteCursorBlock]); + } + onStart?.(); + }, + messages, + streamTools, + llmRequestOptions: { + ...opts, + ...rest, + stream, + }, + }); } diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts index 1321ab5b9d..85804376e6 100644 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -1,6 +1,7 @@ import { CoreMessage } from "ai"; import { OperationsResult } from "../streamTool/callLLMWithStreamTools.js"; import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; +import { createAsyncIterableStreamFromAsyncIterable } from "../util/stream.js"; /** * Result of an LLM call with stream tools that apply changes to a BlockNote Editor @@ -61,4 +62,46 @@ export class LLMResponse { console.log(JSON.stringify(toolCall, null, 2)); } } + + /** + * Create a LLMResponse from an array of operations. + * + * Note: This is a temporary helper, we'll make it easier to create this from streaming data if required + */ + public static fromArray[]>( + messages: CoreMessage[], + streamTools: StreamTool[], + operations: StreamToolCall[], + ): LLMResponse { + return new LLMResponse( + messages, + OperationsResultFromArray(operations), + streamTools, + ); + } +} + +function OperationsResultFromArray[]>( + operations: StreamToolCall[], +): OperationsResult { + async function* singleChunkGenerator() { + for (const op of operations) { + yield { + operation: op, + isUpdateToPreviousOperation: false, + isPossiblyPartial: false, + }; + } + } + + return { + streamObjectResult: undefined, + generateObjectResult: undefined, + get operationsSource() { + return createAsyncIterableStreamFromAsyncIterable(singleChunkGenerator()); + }, + async getGeneratedOperations() { + return { operations }; + }, + }; } diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index fef3fbc230..9a84127930 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -42,4 +42,5 @@ export const llmFormats = { }; export { doLLMRequest as callLLM } from "./LLMRequest.js"; +export { LLMResponse } from "./LLMResponse.js"; export { promptHelpers } from "./promptHelpers/index.js"; diff --git a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts b/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts index 78f7dd0089..ae933692dc 100644 --- a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts +++ b/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts @@ -2,6 +2,7 @@ import { CoreMessage, GenerateObjectResult, LanguageModel, + LanguageModelV1, ObjectStreamPart, StreamObjectResult, generateObject, @@ -11,6 +12,8 @@ import { import { createStreamToolsArraySchema } from "./jsonSchema.js"; +import { ExecuteLLMRequestOptions } from "../api/LLMRequest.js"; +import { LLMResponse } from "../api/LLMResponse.js"; import { AsyncIterableStream, createAsyncIterableStream, @@ -350,3 +353,40 @@ function partialObjectStream( ), ); } + +export function createAISDKLLMRequestExecutor(opts: { + model: LanguageModelV1; +}) { + const { model } = opts; + return async (opts: ExecuteLLMRequestOptions) => { + const { messages, streamTools, llmRequestOptions, onStart } = opts; + const { stream, maxRetries, _generateObjectOptions, _streamObjectOptions } = + llmRequestOptions; + let response: + | Awaited>> + | Awaited>>; + + if (stream) { + response = await streamOperations( + streamTools, + { + messages, + model, + maxRetries, + ...(_streamObjectOptions as any), + }, + onStart, + ); + } else { + response = await generateOperations(streamTools, { + messages, + model, + maxRetries, + ...(_generateObjectOptions as any), + }); + onStart?.(); + } + + return new LLMResponse(messages, response, streamTools); + }; +} From 02757d59fba48bfa5c3e13c4fc283596903d8a2c Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 30 Jul 2025 21:26:04 +0200 Subject: [PATCH 02/68] add manual execution for streamtools --- .../09-ai/05-manual-execution/.bnexample.json | 15 ++ examples/09-ai/05-manual-execution/README.md | 3 + examples/09-ai/05-manual-execution/index.html | 14 ++ examples/09-ai/05-manual-execution/main.tsx | 11 ++ .../09-ai/05-manual-execution/package.json | 34 ++++ .../09-ai/05-manual-execution/src/App.tsx | 183 ++++++++++++++++++ .../09-ai/05-manual-execution/src/getEnv.ts | 20 ++ .../09-ai/05-manual-execution/src/styles.css | 15 ++ .../09-ai/05-manual-execution/tsconfig.json | 33 ++++ .../09-ai/05-manual-execution/vite.config.ts | 32 +++ packages/xl-ai/package.json | 3 +- packages/xl-ai/src/api/LLMResponse.ts | 27 +-- .../base-tools/createUpdateBlockTool.ts | 5 +- .../src/api/formats/html-blocks/htmlBlocks.ts | 2 + .../api/formats/json/tools/jsontools.test.ts | 1 + packages/xl-ai/src/index.ts | 1 + .../src/streamTool/StreamToolExecutor.ts | 151 +++++++++++++++ packages/xl-ai/src/streamTool/streamTool.ts | 10 +- playground/src/examples.gen.tsx | 29 +++ pnpm-lock.yaml | 31 ++- 20 files changed, 588 insertions(+), 32 deletions(-) create mode 100644 examples/09-ai/05-manual-execution/.bnexample.json create mode 100644 examples/09-ai/05-manual-execution/README.md create mode 100644 examples/09-ai/05-manual-execution/index.html create mode 100644 examples/09-ai/05-manual-execution/main.tsx create mode 100644 examples/09-ai/05-manual-execution/package.json create mode 100644 examples/09-ai/05-manual-execution/src/App.tsx create mode 100644 examples/09-ai/05-manual-execution/src/getEnv.ts create mode 100644 examples/09-ai/05-manual-execution/src/styles.css create mode 100644 examples/09-ai/05-manual-execution/tsconfig.json create mode 100644 examples/09-ai/05-manual-execution/vite.config.ts create mode 100644 packages/xl-ai/src/streamTool/StreamToolExecutor.ts diff --git a/examples/09-ai/05-manual-execution/.bnexample.json b/examples/09-ai/05-manual-execution/.bnexample.json new file mode 100644 index 0000000000..6f21dbcd55 --- /dev/null +++ b/examples/09-ai/05-manual-execution/.bnexample.json @@ -0,0 +1,15 @@ +{ + "playground": true, + "docs": false, + "author": "yousefed", + "tags": ["AI", "llm"], + "dependencies": { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "@ai-sdk/groq": "^1.2.9", + "y-partykit": "^0.0.25", + "yjs": "^13.6.27", + "zustand": "^5.0.3" + } +} diff --git a/examples/09-ai/05-manual-execution/README.md b/examples/09-ai/05-manual-execution/README.md new file mode 100644 index 0000000000..003f16a00c --- /dev/null +++ b/examples/09-ai/05-manual-execution/README.md @@ -0,0 +1,3 @@ +# AI manual execution + +Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor diff --git a/examples/09-ai/05-manual-execution/index.html b/examples/09-ai/05-manual-execution/index.html new file mode 100644 index 0000000000..c63d224da9 --- /dev/null +++ b/examples/09-ai/05-manual-execution/index.html @@ -0,0 +1,14 @@ + + + + + AI manual execution + + + +
+ + + diff --git a/examples/09-ai/05-manual-execution/main.tsx b/examples/09-ai/05-manual-execution/main.tsx new file mode 100644 index 0000000000..677c7f7eed --- /dev/null +++ b/examples/09-ai/05-manual-execution/main.tsx @@ -0,0 +1,11 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import React from "react"; +import { createRoot } from "react-dom/client"; +import App from "./src/App.jsx"; + +const root = createRoot(document.getElementById("root")!); +root.render( + + + +); diff --git a/examples/09-ai/05-manual-execution/package.json b/examples/09-ai/05-manual-execution/package.json new file mode 100644 index 0000000000..f47382c37e --- /dev/null +++ b/examples/09-ai/05-manual-execution/package.json @@ -0,0 +1,34 @@ +{ + "name": "@blocknote/example-ai-manual-execution", + "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "private": true, + "version": "0.12.4", + "scripts": { + "start": "vite", + "dev": "vite", + "build:prod": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@blocknote/core": "latest", + "@blocknote/react": "latest", + "@blocknote/ariakit": "latest", + "@blocknote/mantine": "latest", + "@blocknote/shadcn": "latest", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "@ai-sdk/groq": "^1.2.9", + "y-partykit": "^0.0.25", + "yjs": "^13.6.27", + "zustand": "^5.0.3" + }, + "devDependencies": { + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "@vitejs/plugin-react": "^4.3.1", + "vite": "^5.3.4" + } +} \ No newline at end of file diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx new file mode 100644 index 0000000000..38f6f958e7 --- /dev/null +++ b/examples/09-ai/05-manual-execution/src/App.tsx @@ -0,0 +1,183 @@ +import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; +import "@blocknote/core/fonts/inter.css"; +import { en } from "@blocknote/core/locales"; +import { BlockNoteView } from "@blocknote/mantine"; +import "@blocknote/mantine/style.css"; +import { + FormattingToolbar, + FormattingToolbarController, + SuggestionMenuController, + getDefaultReactSlashMenuItems, + getFormattingToolbarItems, + useCreateBlockNote, +} from "@blocknote/react"; +import { + AIToolbarButton, + StreamToolExecutor, + createAIExtension, + getAIExtension, + getAISlashMenuItems, + llmFormats, +} from "@blocknote/xl-ai"; +import { en as aiEn } from "@blocknote/xl-ai/locales"; +import "@blocknote/xl-ai/style.css"; + +export default function App() { + // Creates a new editor instance. + const editor = useCreateBlockNote({ + dictionary: { + ...en, + ai: aiEn, // add default translations for the AI extension + }, + // Register the AI extension + extensions: [ + createAIExtension({ + model: undefined as any, // disable model + }), + ], + // We set some initial content for demo purposes + initialContent: [ + { + type: "heading", + props: { + level: 1, + }, + content: "Open source software", + }, + { + type: "paragraph", + content: + "Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.", + }, + { + type: "paragraph", + content: + "One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.", + }, + { + type: "paragraph", + content: + "Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.", + }, + ], + }); + + // Renders the editor instance using a React component. + return ( +
+ + + {/* + + + */} +
+ {/*Inserts a new block at start of document.*/} + + +
+
+ ); +} + +// Formatting toolbar with the `AIToolbarButton` added +function FormattingToolbarWithAI() { + return ( + ( + + {...getFormattingToolbarItems()} + {/* Add the AI button */} + + + )} + /> + ); +} + +// Slash menu with the AI option added +function SuggestionMenuWithAI(props: { + editor: BlockNoteEditor; +}) { + return ( + + filterSuggestionItems( + [ + ...getDefaultReactSlashMenuItems(props.editor), + // add the default AI slash menu items, or define your own + ...getAISlashMenuItems(props.editor), + ], + query, + ) + } + /> + ); +} diff --git a/examples/09-ai/05-manual-execution/src/getEnv.ts b/examples/09-ai/05-manual-execution/src/getEnv.ts new file mode 100644 index 0000000000..b225fc462e --- /dev/null +++ b/examples/09-ai/05-manual-execution/src/getEnv.ts @@ -0,0 +1,20 @@ +// helper function to get env variables across next / vite +// only needed so this example works in BlockNote demos and docs +export function getEnv(key: string) { + const env = (import.meta as any).env + ? { + BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + } + : { + BLOCKNOTE_AI_SERVER_API_KEY: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + }; + + const value = env[key as keyof typeof env]; + return value; +} diff --git a/examples/09-ai/05-manual-execution/src/styles.css b/examples/09-ai/05-manual-execution/src/styles.css new file mode 100644 index 0000000000..cc97b34a4f --- /dev/null +++ b/examples/09-ai/05-manual-execution/src/styles.css @@ -0,0 +1,15 @@ +.edit-buttons { + display: flex; + justify-content: space-between; + margin-top: 8px; +} + +.edit-button { + border: 1px solid gray; + border-radius: 4px; + padding-inline: 4px; +} + +.edit-button:hover { + border: 1px solid lightgrey; +} diff --git a/examples/09-ai/05-manual-execution/tsconfig.json b/examples/09-ai/05-manual-execution/tsconfig.json new file mode 100644 index 0000000000..3b74ef215c --- /dev/null +++ b/examples/09-ai/05-manual-execution/tsconfig.json @@ -0,0 +1,33 @@ +{ + "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "composite": true + }, + "include": ["."], + "references": [ + { + "path": "../../../packages/core/" + }, + { + "path": "../../../packages/react/" + }, + { + "path": "../../../packages/xl-ai/" + } + ] +} diff --git a/examples/09-ai/05-manual-execution/vite.config.ts b/examples/09-ai/05-manual-execution/vite.config.ts new file mode 100644 index 0000000000..f62ab20bc2 --- /dev/null +++ b/examples/09-ai/05-manual-execution/vite.config.ts @@ -0,0 +1,32 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import react from "@vitejs/plugin-react"; +import * as fs from "fs"; +import * as path from "path"; +import { defineConfig } from "vite"; +// import eslintPlugin from "vite-plugin-eslint"; +// https://vitejs.dev/config/ +export default defineConfig((conf) => ({ + plugins: [react()], + optimizeDeps: {}, + build: { + sourcemap: true, + }, + resolve: { + alias: + conf.command === "build" || + !fs.existsSync(path.resolve(__dirname, "../../packages/core/src")) + ? {} + : ({ + // Comment out the lines below to load a built version of blocknote + // or, keep as is to load live from sources with live reload working + "@blocknote/core": path.resolve( + __dirname, + "../../packages/core/src/" + ), + "@blocknote/react": path.resolve( + __dirname, + "../../packages/react/src/" + ), + } as any), + }, +})); diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index c28c8339f2..5e45a18fca 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -70,7 +70,8 @@ "@blocknote/react": "0.35.0", "@floating-ui/react": "^0.26.4", "@tiptap/core": "^2.12.0", - "ai": "^4.3.15", + "ai": "^4.3.19", + "@ai-sdk/ui-utils": "^1.2.11", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", "prosemirror-model": "^1.24.1", diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts index 1321ab5b9d..46460b3e71 100644 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -1,6 +1,7 @@ import { CoreMessage } from "ai"; import { OperationsResult } from "../streamTool/callLLMWithStreamTools.js"; -import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; +import { StreamTool } from "../streamTool/streamTool.js"; +import { StreamToolExecutor } from "../streamTool/StreamToolExecutor.js"; /** * Result of an LLM call with stream tools that apply changes to a BlockNote Editor @@ -23,33 +24,15 @@ export class LLMResponse { private readonly streamTools: StreamTool[], ) {} - /** - * Apply the operations to the editor and return a stream of results. - * - * (this method consumes underlying streams in `llmResult`) - */ - async *applyToolCalls() { - let currentStream: AsyncIterable<{ - operation: StreamToolCall[]>; - isUpdateToPreviousOperation: boolean; - isPossiblyPartial: boolean; - }> = this.llmResult.operationsSource; - for (const tool of this.streamTools) { - currentStream = tool.execute(currentStream); - } - yield* currentStream; - } - /** * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results. * * (this method consumes underlying streams in `llmResult`) */ public async execute() { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - for await (const _result of this.applyToolCalls()) { - // no op - } + const executor = new StreamToolExecutor(this.streamTools); + await executor.execute(this.llmResult.operationsSource); + await executor.waitTillEnd(); } /** diff --git a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts index 6a81d0d469..7d22edab74 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts @@ -196,10 +196,11 @@ export function createUpdateBlockTool(config: { } const operation = chunk.operation as UpdateBlockToolCall; - + console.log("first op"); if (chunk.isPossiblyPartial) { const size = JSON.stringify(operation.block).length; if (size < minSize) { + console.log("skipping", size, minSize); continue; } else { // increase minSize for next chunk @@ -224,6 +225,7 @@ export function createUpdateBlockTool(config: { const jsonToolCall = await config.toJSONToolCall(editor, chunk); if (!jsonToolCall) { + console.log("no jsonToolCall"); continue; } @@ -242,6 +244,7 @@ export function createUpdateBlockTool(config: { // if there's only a single replace step to be done and we're partial, let's wait for more content // REC: unit test this and see if it's still needed even if we pass `dontReplaceContentAtEnd` to `updateToReplaceSteps` + console.log("skipping", steps.length, chunk.isPossiblyPartial); continue; } diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index e819271f58..c657d377d4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -59,6 +59,8 @@ export const htmlBlockLLMFormat = { * Function to get the stream tools that can apply HTML block updates to the editor */ getStreamTools, + + streamTools: tools, /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts index 065a09b5ac..ad7ee80d35 100644 --- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts +++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts @@ -17,6 +17,7 @@ import { tools } from "./index.js"; import { getAIExtension } from "../../../../AIExtension.js"; import { getExpectedEditor } from "../../../../testUtil/cases/index.js"; import { validateRejectingResultsInOriginalDoc } from "../../../../testUtil/suggestChangesTestUtil.js"; + async function* createMockStream( ...operations: { operation: diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts index 0f35bd8e3f..c002ac5418 100644 --- a/packages/xl-ai/src/index.ts +++ b/packages/xl-ai/src/index.ts @@ -13,3 +13,4 @@ export * from "./components/SuggestionMenu/getAISlashMenuItems.js"; export * from "./i18n/dictionary.js"; export * from "./api/index.js"; +export * from "./streamTool/StreamToolExecutor.js"; diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts new file mode 100644 index 0000000000..283ab37d28 --- /dev/null +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -0,0 +1,151 @@ +import { parsePartialJson } from "@ai-sdk/ui-utils"; +import { + asyncIterableToStream, + createAsyncIterableStream, +} from "../util/stream.js"; +import { StreamTool, StreamToolCall } from "./streamTool.js"; + +// update previous + +function partialJsonToOperation( + chunk: string, + isUpdateToPreviousOperation: boolean, + streamTools: StreamTool[], +) { + const parsed = parsePartialJson(chunk); + + if (parsed.state === "undefined-input" || parsed.state === "failed-parse") { + return undefined; + } + + if (!parsed) { + return; + } + + const func = streamTools.find((f) => f.name === (parsed.value as any)?.type); + + const validated = func && func.validate(parsed.value); + + if (validated?.ok) { + return { + operation: parsed.value as StreamToolCall[]>, + isPossiblyPartial: parsed.state === "repaired-parse", + isUpdateToPreviousOperation, + }; + } else { + // no worries, probably a partial operation that's not valid yet + return; + } +} + +type Operation[] | StreamTool> = { + operation: StreamToolCall; + isUpdateToPreviousOperation: boolean; + isPossiblyPartial: boolean; +}; + +export class StreamToolExecutor[]> { + private readonly stream: TransformStream, Operation>; + private readonly readable: ReadableStream>; + + constructor(private streamTools: T) { + this.stream = this.createWriteStream(); + this.readable = this.createReadableStream(); + } + /** + * Returns a WritableStream that collects written chunks. + */ + private createWriteStream() { + let lastParsedResult: Operation | undefined; + + const stream = new TransformStream, Operation>({ + transform: (chunk, controller) => { + const operation = + typeof chunk === "string" + ? partialJsonToOperation( + chunk, + lastParsedResult?.isPossiblyPartial ?? false, + this.streamTools, + ) + : chunk; + if (operation) { + // TODO: string operations have been validated, but object-based operations have not. make this consistent? + controller.enqueue(operation); + } + }, + + // close: () => { + // if (lastParsedResult?.isPossiblyPartial) { + // throw new Error("stream ended with a partial operation"); + // } + // } + }); + + return stream; + } + + public get writable() { + return this.stream.writable; + } + + private createReadableStream() { + // TODO: this is a bit hacky as it mixes async iterables and streams + let currentStream: AsyncIterable[]>> = + createAsyncIterableStream(this.stream.readable); + for (const tool of this.streamTools) { + currentStream = tool.execute(currentStream); + } + + return asyncIterableToStream(currentStream); + } + + /** + * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results. + * + * (this method consumes underlying streams in `llmResult`) + */ + public async waitTillEnd() { + const iterable = createAsyncIterableStream(this.readable); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for await (const _result of iterable) { + // no op + } + } + + /** + * Accepts an async iterable and writes each chunk to the internal stream. + */ + async execute(source: AsyncIterable>): Promise { + const writer = this.writable.getWriter(); + for await (const chunk of source) { + await writer.write(chunk); + } + await writer.close(); + } + + /** + * Accepts a single chunk and processes it using the same logic. + */ + async executeOne(chunk: StreamToolCall): Promise { + await this.execute( + (async function* () { + yield { + operation: chunk, + isUpdateToPreviousOperation: false, + isPossiblyPartial: false, + }; + })(), + ); + } +} + +/* TODO: + +AI SDK integration: +- pass tools +- server side +- stream tool outputs (partial-tool-data) + +Hook up custom executors + +*/ diff --git a/packages/xl-ai/src/streamTool/streamTool.ts b/packages/xl-ai/src/streamTool/streamTool.ts index d907d1315e..7257a1adc4 100644 --- a/packages/xl-ai/src/streamTool/streamTool.ts +++ b/packages/xl-ai/src/streamTool/streamTool.ts @@ -66,14 +66,14 @@ export type StreamToolCallSingle> = * * Its type is the same as what a validated StreamTool returns */ -export type StreamToolCall | StreamTool[]> = +export type StreamToolCall | readonly any[]> = T extends StreamTool ? U : // when passed an array of StreamTools, StreamToolCall represents the type of one of the StreamTool invocations - T extends StreamTool[] - ? T[number] extends StreamTool - ? V - : never + T extends readonly unknown[] + ? { + [K in keyof T]: T[K] extends StreamTool ? V : never; + }[number] : never; /** diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 0cd32ceb3f..4cb9ee6d4e 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1651,6 +1651,35 @@ "slug": "ai" }, "readme": "This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)\n- [Getting Stared with BlockNote AI](/docs/features/ai/setup)" + }, + { + "projectSlug": "manual-execution", + "fullSlug": "ai/manual-execution", + "pathFromRoot": "examples/09-ai/05-manual-execution", + "config": { + "playground": true, + "docs": false, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "@ai-sdk/groq": "^1.2.9", + "y-partykit": "^0.0.25", + "yjs": "^13.6.27", + "zustand": "^5.0.3" + } as any + }, + "title": "AI manual execution", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor" } ] }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9657b2a136..d4293b7893 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4012,6 +4012,9 @@ importers: packages/xl-ai: dependencies: + '@ai-sdk/ui-utils': + specifier: ^1.2.11 + version: 1.2.11(zod@3.25.76) '@blocknote/core': specifier: 0.35.0 version: link:../core @@ -4031,8 +4034,8 @@ importers: specifier: ^2.12.0 version: 2.12.0(@tiptap/pm@2.12.0) ai: - specifier: ^4.3.15 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^4.3.19 + version: 4.3.19(react@19.1.0)(zod@3.25.76) lodash.isequal: specifier: ^4.5.0 version: 4.5.0 @@ -9810,6 +9813,16 @@ packages: react: optional: true + ai@4.3.19: + resolution: {integrity: sha512-dIE2bfNpqHN3r6IINp9znguYdhIOheKW2LDigAMrgt/upT3B8eBGPSCblENvaZGoq+hxaN9fSMzjWpbqloP+7Q==} + engines: {node: '>=18'} + peerDependencies: + react: ^18 || ^19 || ^19.0.0-rc + zod: ^3.23.8 + peerDependenciesMeta: + react: + optional: true + ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -21074,6 +21087,18 @@ snapshots: optionalDependencies: react: 19.1.0 + ai@4.3.19(react@19.1.0)(zod@3.25.76): + dependencies: + '@ai-sdk/provider': 1.1.3 + '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/react': 1.2.12(react@19.1.0)(zod@3.25.76) + '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) + '@opentelemetry/api': 1.9.0 + jsondiffpatch: 0.6.0 + zod: 3.25.76 + optionalDependencies: + react: 19.1.0 + ajv-formats@2.1.1(ajv@8.17.1): optionalDependencies: ajv: 8.17.1 @@ -26691,7 +26716,7 @@ snapshots: dependencies: dequal: 2.0.3 react: 19.1.0 - use-sync-external-store: 1.4.0(react@19.1.0) + use-sync-external-store: 1.5.0(react@19.1.0) symbol-tree@3.2.4: {} From 23e8f491f07e383e54c90b96d8bd4a7c95d85dcd Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 31 Jul 2025 11:25:05 +0200 Subject: [PATCH 03/68] server wip --- packages/xl-ai-server/package.json | 3 +- packages/xl-ai-server/src/index.ts | 104 +---------------------------- pnpm-lock.yaml | 61 +++++++++++++++++ 3 files changed, 66 insertions(+), 102 deletions(-) diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index 8e4133385e..4c7ec9aac2 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -44,7 +44,8 @@ }, "dependencies": { "@hono/node-server": "^1.13.7", - "hono": "^4.6.12" + "hono": "^4.6.12", + "ai": "^4.3.19" }, "devDependencies": { "eslint": "^8.10.0", diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts index f5ce73b3ae..bbef194464 100644 --- a/packages/xl-ai-server/src/index.ts +++ b/packages/xl-ai-server/src/index.ts @@ -1,10 +1,10 @@ import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { bearerAuth } from "hono/bearer-auth"; -import { cors } from "hono/cors"; import { existsSync, readFileSync } from "node:fs"; import { createSecureServer } from "node:http2"; import { Agent, setGlobalDispatcher } from "undici"; +import { proxyRoute } from "./proxy"; // make sure our fetch request uses HTTP/2 setGlobalDispatcher( @@ -13,73 +13,6 @@ setGlobalDispatcher( }), ); -const ignoreHeadersRe = /^content-(?:encoding|length|range)$/i; - -// REC: we might be able to replace this by https://github.com/honojs/hono/pull/3589 -export const proxyFetch: typeof fetch = async (request, options) => { - const req = new Request(request, options); - req.headers.delete("accept-encoding"); // TBD: there may be cases where you want to explicitly specify - req.headers.delete("Origin"); - const res = await fetch(req); - - const headers: HeadersInit = [...res.headers.entries()].filter( - ([k]) => !ignoreHeadersRe.test(k) && k !== "strict-transport-security", - ); - - const readable = res.body; - - // For debugging purposes, we can log the chunks as they stream: - - // const { readable, writable } = new TransformStream({ - // async transform(chunk, controller) { - // // Log each chunk as it passes through - - // // optional, wait to test streaming mode - // // await new Promise((resolve) => setTimeout(resolve, 3000)); - - // console.log("Streaming chunk:", new TextDecoder().decode(chunk)); - // controller.enqueue(chunk); - // }, - // }); - - // // Pipe the response body through our transform stream - // res.body?.pipeTo(writable).catch((err) => { - // console.error("Error in stream:", err); - // }); - - return new Response(readable, { - ...res, - status: res.status, - statusText: res.statusText, - headers, - }); -}; - -function getProviderInfo(provider: string) { - const envKey = `${provider.toUpperCase().replace(/-/g, "_")}_API_KEY`; - const key = process.env[envKey]; - if (!key || !key.length) { - return "not-found"; - } - if (provider === "google") { - return { - key, - header: "x-goog-api-key", - }; - } - if (provider === "anthropic") { - return { - key, - header: "x-api-key", - }; - } - - return { - key, - header: "Authorization", - }; -} - const app = new Hono(); app.use("/health", async (c) => { @@ -93,39 +26,8 @@ if (process.env.TOKEN?.length) { console.warn("no token set, ai requests will not be secured"); } -app.use("/ai", cors(), async (c) => { - const url = c.req.query("url"); - if (!url) { - return c.json({ error: "url parameter is required" }, 400); - } - - const provider = c.req.query("provider"); - if (!provider) { - return c.json({ error: "provider parameter is required" }, 400); - } - - const providerInfo = getProviderInfo(provider); - - if (providerInfo === "not-found") { - return c.json( - { - error: `provider / key not found for provider ${provider}. Make sure to load correct env variables.`, - }, - 404, - ); - } - - // eslint-disable-next-line no-console - console.log("Proxying request to", url); - const request = new Request(url, c.req.raw); - if (providerInfo.header === "Authorization") { - request.headers.set("Authorization", `Bearer ${providerInfo.key}`); - } else { - request.headers.set(providerInfo.header, `${providerInfo.key}`); - } - - return proxyFetch(request); -}); +app.route("/ai/proxy", proxyRoute); +app.route("/ai/vercel-ai-sdk", vercelAiSdkRoute); const http2 = existsSync("localhost.pem"); serve( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9657b2a136..2390ecf8ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3303,6 +3303,64 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/09-ai/05-manual-execution: + dependencies: + '@ai-sdk/groq': + specifier: ^1.2.9 + version: 1.2.9(zod@3.25.76) + '@blocknote/ariakit': + specifier: latest + version: link:../../../packages/ariakit + '@blocknote/core': + specifier: latest + version: link:../../../packages/core + '@blocknote/mantine': + specifier: latest + version: link:../../../packages/mantine + '@blocknote/react': + specifier: latest + version: link:../../../packages/react + '@blocknote/shadcn': + specifier: latest + version: link:../../../packages/shadcn + '@blocknote/xl-ai': + specifier: latest + version: link:../../../packages/xl-ai + '@mantine/core': + specifier: ^7.17.3 + version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + ai: + specifier: ^4.3.15 + version: 4.3.19(react@19.1.0)(zod@3.25.76) + react: + specifier: ^19.1.0 + version: 19.1.0 + react-dom: + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) + y-partykit: + specifier: ^0.0.25 + version: 0.0.25 + yjs: + specifier: ^13.6.27 + version: 13.6.27 + zustand: + specifier: ^5.0.3 + version: 5.0.3(@types/react@19.1.8)(immer@10.1.1)(react@19.1.0)(use-sync-external-store@1.5.0(react@19.1.0)) + devDependencies: + '@types/react': + specifier: ^19.1.0 + version: 19.1.8 + '@types/react-dom': + specifier: ^19.1.0 + version: 19.1.6(@types/react@19.1.8) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.4.1(vite@5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1)) + vite: + specifier: ^5.3.4 + version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/vanilla-js/react-vanilla-custom-blocks: dependencies: '@blocknote/ariakit': @@ -4169,6 +4227,9 @@ importers: '@hono/node-server': specifier: ^1.13.7 version: 1.14.0(hono@4.7.5) + ai: + specifier: ^4.3.19 + version: 4.3.19(react@19.1.0)(zod@3.25.76) hono: specifier: ^4.6.12 version: 4.7.5 From c58ecb45a9b988b869449c0ae2f0d85ea5386d2e Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 31 Jul 2025 11:25:24 +0200 Subject: [PATCH 04/68] server wip --- packages/xl-ai-server/src/proxy.ts | 105 +++++++++++++++++++++++ packages/xl-ai-server/src/vercelAISDK.ts | 38 ++++++++ 2 files changed, 143 insertions(+) create mode 100644 packages/xl-ai-server/src/proxy.ts create mode 100644 packages/xl-ai-server/src/vercelAISDK.ts diff --git a/packages/xl-ai-server/src/proxy.ts b/packages/xl-ai-server/src/proxy.ts new file mode 100644 index 0000000000..59e478b0fc --- /dev/null +++ b/packages/xl-ai-server/src/proxy.ts @@ -0,0 +1,105 @@ +import { Hono } from "hono"; +import { cors } from "hono/cors"; + +const ignoreHeadersRe = /^content-(?:encoding|length|range)$/i; + +// REC: we might be able to replace this by https://github.com/honojs/hono/pull/3589 +export const proxyFetch: typeof fetch = async (request, options) => { + const req = new Request(request, options); + req.headers.delete("accept-encoding"); // TBD: there may be cases where you want to explicitly specify + req.headers.delete("Origin"); + const res = await fetch(req); + + const headers: HeadersInit = [...res.headers.entries()].filter( + ([k]) => !ignoreHeadersRe.test(k) && k !== "strict-transport-security", + ); + + const readable = res.body; + + // For debugging purposes, we can log the chunks as they stream: + + // const { readable, writable } = new TransformStream({ + // async transform(chunk, controller) { + // // Log each chunk as it passes through + + // // optional, wait to test streaming mode + // // await new Promise((resolve) => setTimeout(resolve, 3000)); + + // console.log("Streaming chunk:", new TextDecoder().decode(chunk)); + // controller.enqueue(chunk); + // }, + // }); + + // // Pipe the response body through our transform stream + // res.body?.pipeTo(writable).catch((err) => { + // console.error("Error in stream:", err); + // }); + + return new Response(readable, { + ...res, + status: res.status, + statusText: res.statusText, + headers, + }); +}; + +function getProviderInfo(provider: string) { + const envKey = `${provider.toUpperCase().replace(/-/g, "_")}_API_KEY`; + const key = process.env[envKey]; + if (!key || !key.length) { + return "not-found"; + } + if (provider === "google") { + return { + key, + header: "x-goog-api-key", + }; + } + if (provider === "anthropic") { + return { + key, + header: "x-api-key", + }; + } + + return { + key, + header: "Authorization", + }; +} + +export const proxyRoute = new Hono(); + +proxyRoute.use("", cors(), async (c) => { + const url = c.req.query("url"); + if (!url) { + return c.json({ error: "url parameter is required" }, 400); + } + + const provider = c.req.query("provider"); + if (!provider) { + return c.json({ error: "provider parameter is required" }, 400); + } + + const providerInfo = getProviderInfo(provider); + + if (providerInfo === "not-found") { + return c.json( + { + error: `provider / key not found for provider ${provider}. Make sure to load correct env variables.`, + }, + 404, + ); + } + + // eslint-disable-next-line no-console + console.log("Proxying request to", url); + const request = new Request(url, c.req.raw); + if (providerInfo.header === "Authorization") { + request.headers.set("Authorization", `Bearer ${providerInfo.key}`); + } else { + request.headers.set(providerInfo.header, `${providerInfo.key}`); + } + + return proxyFetch(request); +}); diff --git a/packages/xl-ai-server/src/vercelAISDK.ts b/packages/xl-ai-server/src/vercelAISDK.ts new file mode 100644 index 0000000000..e6cccc4570 --- /dev/null +++ b/packages/xl-ai-server/src/vercelAISDK.ts @@ -0,0 +1,38 @@ +import { openai } from "@ai-sdk/openai"; +import { streamObject, streamText, tool } from "ai"; +import { Hono } from "hono"; +import { cors } from "hono/cors"; + +export const vercelAiSdkRoute = new Hono(); + +vercelAiSdkRoute.post("/streamText", cors(), async (c) => { + const { messages } = await c.req.json(); + + const result = streamText({ + model: openai("gpt-4-turbo"), + system: "You are a helpful assistant.", + messages, + toolCallStreaming: true, + tools: { + add: tool({}), + }, + }); + + return result.toDataStreamResponse(); +}); + +vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { + const { messages } = await c.req.json(); + + const result = streamObject({ + model: openai("gpt-4-turbo"), + system: "You are a helpful assistant.", + messages, + + tools: { + add: tool({}), + }, + }); + + return result.toDataStreamResponse(); +}); From 3a278a1cdb23da601cee2ee5d1a1d10d58b8858b Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 31 Jul 2025 12:20:29 +0200 Subject: [PATCH 05/68] update PR --- docs/content/docs/ai/reference.mdx | 6 +- docs/content/docs/features/ai/reference.mdx | 6 +- .../09-ai/05-manual-execution/src/App.tsx | 151 ++++++++++-------- packages/xl-ai/src/api/LLMRequest.ts | 6 +- .../base-tools/createUpdateBlockTool.ts | 4 - .../src/api/formats/html-blocks/htmlBlocks.ts | 55 ++++--- .../src/streamTool/StreamToolExecutor.ts | 140 +++++++++------- 7 files changed, 213 insertions(+), 155 deletions(-) diff --git a/docs/content/docs/ai/reference.mdx b/docs/content/docs/ai/reference.mdx index 7be4973f96..33eae9ed98 100644 --- a/docs/content/docs/ai/reference.mdx +++ b/docs/content/docs/ai/reference.mdx @@ -206,11 +206,11 @@ type LLMRequestOptions = { * @default { add: true, update: true, delete: true } */ defaultStreamTools?: { - /** Enable the add tool (default: true) */ + /** Enable the add tool (default: false) */ add?: boolean; - /** Enable the update tool (default: true) */ + /** Enable the update tool (default: false) */ update?: boolean; - /** Enable the delete tool (default: true) */ + /** Enable the delete tool (default: false) */ delete?: boolean; }; /** diff --git a/docs/content/docs/features/ai/reference.mdx b/docs/content/docs/features/ai/reference.mdx index 7be4973f96..33eae9ed98 100644 --- a/docs/content/docs/features/ai/reference.mdx +++ b/docs/content/docs/features/ai/reference.mdx @@ -206,11 +206,11 @@ type LLMRequestOptions = { * @default { add: true, update: true, delete: true } */ defaultStreamTools?: { - /** Enable the add tool (default: true) */ + /** Enable the add tool (default: false) */ add?: boolean; - /** Enable the update tool (default: true) */ + /** Enable the update tool (default: false) */ update?: boolean; - /** Enable the delete tool (default: true) */ + /** Enable the delete tool (default: false) */ delete?: boolean; }; /** diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx index 38f6f958e7..ffab193b04 100644 --- a/examples/09-ai/05-manual-execution/src/App.tsx +++ b/examples/09-ai/05-manual-execution/src/App.tsx @@ -1,22 +1,12 @@ -import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; import { BlockNoteView } from "@blocknote/mantine"; import "@blocknote/mantine/style.css"; +import { useCreateBlockNote } from "@blocknote/react"; import { - FormattingToolbar, - FormattingToolbarController, - SuggestionMenuController, - getDefaultReactSlashMenuItems, - getFormattingToolbarItems, - useCreateBlockNote, -} from "@blocknote/react"; -import { - AIToolbarButton, StreamToolExecutor, createAIExtension, getAIExtension, - getAISlashMenuItems, llmFormats, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; @@ -65,35 +55,33 @@ export default function App() { // Renders the editor instance using a React component. return (
- - - {/* - - - */} + +
{/*Inserts a new block at start of document.*/} -
-
- ); -} + + + ); } diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index 170e020e5b..529954162d 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -62,11 +62,11 @@ export type LLMRequestOptions = { * @default { add: true, update: true, delete: true } */ defaultStreamTools?: { - /** Enable the add tool (default: true) */ + /** Enable the add tool (default: false) */ add?: boolean; - /** Enable the update tool (default: true) */ + /** Enable the update tool (default: false) */ update?: boolean; - /** Enable the delete tool (default: true) */ + /** Enable the delete tool (default: false) */ delete?: boolean; }; /** diff --git a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts index 7d22edab74..f3a16f7a3d 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts @@ -196,11 +196,9 @@ export function createUpdateBlockTool(config: { } const operation = chunk.operation as UpdateBlockToolCall; - console.log("first op"); if (chunk.isPossiblyPartial) { const size = JSON.stringify(operation.block).length; if (size < minSize) { - console.log("skipping", size, minSize); continue; } else { // increase minSize for next chunk @@ -225,7 +223,6 @@ export function createUpdateBlockTool(config: { const jsonToolCall = await config.toJSONToolCall(editor, chunk); if (!jsonToolCall) { - console.log("no jsonToolCall"); continue; } @@ -244,7 +241,6 @@ export function createUpdateBlockTool(config: { // if there's only a single replace step to be done and we're partial, let's wait for more content // REC: unit test this and see if it's still needed even if we pass `dontReplaceContentAtEnd` to `updateToReplaceSteps` - console.log("skipping", steps.length, chunk.isPossiblyPartial); continue; } diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index c657d377d4..bf78be57b7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -8,29 +8,48 @@ import { } from "./htmlPromptData.js"; import { tools } from "./tools/index.js"; -function getStreamTools( +// Import the tool call types +import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; +import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; +import { DeleteBlockToolCall } from "../base-tools/delete.js"; + +// Define the tool types +export type AddTool = StreamTool>; +export type UpdateTool = StreamTool>; +export type DeleteTool = StreamTool; + +// Create a conditional type that maps boolean flags to tool types +export type StreamToolsConfig = { + add?: boolean; + update?: boolean; + delete?: boolean; +}; + +export type StreamToolsResult = [ + ...(T extends { update: true } ? [UpdateTool] : []), + ...(T extends { add: true } ? [AddTool] : []), + ...(T extends { delete: true } ? [DeleteTool] : []), +]; + +function getStreamTools< + T extends StreamToolsConfig = { add: true; update: true; delete: true }, +>( editor: BlockNoteEditor, withDelays: boolean, - defaultStreamTools?: { - /** Enable the add tool (default: true) */ - add?: boolean; - /** Enable the update tool (default: true) */ - update?: boolean; - /** Enable the delete tool (default: true) */ - delete?: boolean; - }, + defaultStreamTools?: T, selectionInfo?: { from: number; to: number; }, onBlockUpdate?: (blockId: string) => void, -) { - const mergedStreamTools = { - add: true, - update: true, - delete: true, - ...defaultStreamTools, - }; +): StreamToolsResult { + const mergedStreamTools = + defaultStreamTools ?? + ({ + add: true, + update: true, + delete: true, + } as T); const streamTools: StreamTool[] = [ ...(mergedStreamTools.update @@ -51,7 +70,7 @@ function getStreamTools( : []), ]; - return streamTools; + return streamTools as StreamToolsResult; } export const htmlBlockLLMFormat = { @@ -59,8 +78,6 @@ export const htmlBlockLLMFormat = { * Function to get the stream tools that can apply HTML block updates to the editor */ getStreamTools, - - streamTools: tools, /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index 283ab37d28..9da933431f 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -5,56 +5,51 @@ import { } from "../util/stream.js"; import { StreamTool, StreamToolCall } from "./streamTool.js"; -// update previous - -function partialJsonToOperation( - chunk: string, - isUpdateToPreviousOperation: boolean, - streamTools: StreamTool[], -) { - const parsed = parsePartialJson(chunk); - - if (parsed.state === "undefined-input" || parsed.state === "failed-parse") { - return undefined; - } - - if (!parsed) { - return; - } - - const func = streamTools.find((f) => f.name === (parsed.value as any)?.type); - - const validated = func && func.validate(parsed.value); - - if (validated?.ok) { - return { - operation: parsed.value as StreamToolCall[]>, - isPossiblyPartial: parsed.state === "repaired-parse", - isUpdateToPreviousOperation, - }; - } else { - // no worries, probably a partial operation that's not valid yet - return; - } -} - +/** + * The Operation types wraps a StreamToolCall with metadata on whether + * it's an update to an existing and / or or a possibly partial (i.e.: incomplete, streaming in progress) operation + */ type Operation[] | StreamTool> = { + /** + * The StreamToolCall (parameters representing a StreamTool invocation) + */ operation: StreamToolCall; + /** + * Whether this operation is an update to the previous operation + * (i.e.: the previous operation was a partial operation for which we now have additional data) + */ isUpdateToPreviousOperation: boolean; + /** + * Whether this operation is a partial operation + * (i.e.: incomplete, streaming in progress) + */ isPossiblyPartial: boolean; }; +/** + * The StreamToolExecutor can apply StreamToolCalls to an editor. + * + * It accepts StreamToolCalls as JSON strings or already parsed and validated Operations. + * Note: When passing JSON strings, the executor will parse and validate them into Operations. + * When passing Operations, they're expected to have been validated by the StreamTool instances already. + * (StreamTool.validate) + * + * Applying the operations is delegated to the StreamTool instances. + * + * @example see the `manual-execution` example + */ export class StreamToolExecutor[]> { private readonly stream: TransformStream, Operation>; private readonly readable: ReadableStream>; + /** + * @param streamTools - The StreamTools to use to apply the StreamToolCalls + */ constructor(private streamTools: T) { this.stream = this.createWriteStream(); this.readable = this.createReadableStream(); } - /** - * Returns a WritableStream that collects written chunks. - */ + private createWriteStream() { let lastParsedResult: Operation | undefined; @@ -69,27 +64,27 @@ export class StreamToolExecutor[]> { ) : chunk; if (operation) { - // TODO: string operations have been validated, but object-based operations have not. make this consistent? + // TODO: string operations have been validated, but object-based operations have not. + // To make this consistent, maybe we should extract the string parser to a separate transformer + lastParsedResult = operation; controller.enqueue(operation); } }, - // close: () => { - // if (lastParsedResult?.isPossiblyPartial) { - // throw new Error("stream ended with a partial operation"); - // } - // } + flush: (controller) => { + // Check if the stream ended with a partial operation + if (lastParsedResult?.isPossiblyPartial) { + controller.error(new Error("stream ended with a partial operation")); + } + }, }); return stream; } - public get writable() { - return this.stream.writable; - } - private createReadableStream() { - // TODO: this is a bit hacky as it mixes async iterables and streams + // this is a bit hacky as it mixes async iterables and streams + // would be better to stick to streams let currentStream: AsyncIterable[]>> = createAsyncIterableStream(this.stream.readable); for (const tool of this.streamTools) { @@ -101,19 +96,30 @@ export class StreamToolExecutor[]> { /** * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results. - * - * (this method consumes underlying streams in `llmResult`) */ public async waitTillEnd() { const iterable = createAsyncIterableStream(this.readable); // eslint-disable-next-line @typescript-eslint/no-unused-vars for await (const _result of iterable) { // no op + // these will be operations without a matching StreamTool. + // (we probably want to allow a way to access and handle these, but for now we haven't run into this scenario yet) } } + /** + * Returns a WritableStream that can be used to write StreamToolCalls to the executor. + * + * The WriteableStream accepts JSON strings or Operation objects. + */ + public get writable() { + return this.stream.writable; + } + /** * Accepts an async iterable and writes each chunk to the internal stream. + * + * (alternative to writing to the writable stream using {@link writable}) */ async execute(source: AsyncIterable>): Promise { const writer = this.writable.getWriter(); @@ -125,6 +131,8 @@ export class StreamToolExecutor[]> { /** * Accepts a single chunk and processes it using the same logic. + * + * (alternative to writing to the writable stream using {@link writable}) */ async executeOne(chunk: StreamToolCall): Promise { await this.execute( @@ -139,13 +147,33 @@ export class StreamToolExecutor[]> { } } -/* TODO: +function partialJsonToOperation[]>( + chunk: string, + isUpdateToPreviousOperation: boolean, + streamTools: T, +): Operation | undefined { + const parsed = parsePartialJson(chunk); -AI SDK integration: -- pass tools -- server side -- stream tool outputs (partial-tool-data) + if (parsed.state === "undefined-input" || parsed.state === "failed-parse") { + return undefined; + } + + if (!parsed) { + return; + } -Hook up custom executors + const func = streamTools.find((f) => f.name === (parsed.value as any)?.type); -*/ + const validated = func && func.validate(parsed.value); + + if (validated?.ok) { + return { + operation: validated.value as StreamToolCall, + isPossiblyPartial: parsed.state === "repaired-parse", + isUpdateToPreviousOperation, + }; + } else { + // no worries, probably a partial operation that's not valid yet + return; + } +} From e15255092f15adc3baf7dee7690d9091d3bdc876 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 31 Jul 2025 12:35:33 +0200 Subject: [PATCH 06/68] update lock --- pnpm-lock.yaml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4293b7893..e9d3e4f182 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3303,6 +3303,64 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/09-ai/05-manual-execution: + dependencies: + '@ai-sdk/groq': + specifier: ^1.2.9 + version: 1.2.9(zod@3.25.76) + '@blocknote/ariakit': + specifier: latest + version: link:../../../packages/ariakit + '@blocknote/core': + specifier: latest + version: link:../../../packages/core + '@blocknote/mantine': + specifier: latest + version: link:../../../packages/mantine + '@blocknote/react': + specifier: latest + version: link:../../../packages/react + '@blocknote/shadcn': + specifier: latest + version: link:../../../packages/shadcn + '@blocknote/xl-ai': + specifier: latest + version: link:../../../packages/xl-ai + '@mantine/core': + specifier: ^7.17.3 + version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + ai: + specifier: ^4.3.15 + version: 4.3.19(react@19.1.0)(zod@3.25.76) + react: + specifier: ^19.1.0 + version: 19.1.0 + react-dom: + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) + y-partykit: + specifier: ^0.0.25 + version: 0.0.25 + yjs: + specifier: ^13.6.27 + version: 13.6.27 + zustand: + specifier: ^5.0.3 + version: 5.0.3(@types/react@19.1.8)(immer@10.1.1)(react@19.1.0)(use-sync-external-store@1.5.0(react@19.1.0)) + devDependencies: + '@types/react': + specifier: ^19.1.0 + version: 19.1.8 + '@types/react-dom': + specifier: ^19.1.0 + version: 19.1.6(@types/react@19.1.8) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.4.1(vite@5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1)) + vite: + specifier: ^5.3.4 + version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/vanilla-js/react-vanilla-custom-blocks: dependencies: '@blocknote/ariakit': From 10b60ea05d3e69664bffd033e7c385a7f200346b Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 31 Jul 2025 19:15:34 +0200 Subject: [PATCH 07/68] add example --- docs/package.json | 2 +- examples/09-ai/01-minimal/src/App.tsx | 10 +- .../09-ai/05-manual-execution/src/App.tsx | 2 +- .../09-ai/05-manual-execution/tsconfig.json | 17 +- .../09-ai/06-server-execution/.bnexample.json | 12 + examples/09-ai/06-server-execution/README.md | 3 + examples/09-ai/06-server-execution/index.html | 14 + examples/09-ai/06-server-execution/main.tsx | 11 + .../09-ai/06-server-execution/package.json | 31 ++ .../09-ai/06-server-execution/src/App.tsx | 158 +++++++ .../09-ai/06-server-execution/src/getEnv.ts | 20 + .../09-ai/06-server-execution/tsconfig.json | 33 ++ .../09-ai/06-server-execution/vite.config.ts | 32 ++ packages/xl-ai-server/package.json | 4 +- packages/xl-ai-server/src/index.ts | 3 +- .../xl-ai-server/src/{ => routes}/proxy.ts | 0 .../xl-ai-server/src/routes/vercelAiSdk.ts | 97 +++++ packages/xl-ai-server/src/vercelAISDK.ts | 38 -- packages/xl-ai-server/vite.config.ts | 1 + packages/xl-ai/package.json | 1 + packages/xl-ai/src/AIExtension.ts | 25 +- packages/xl-ai/src/api/LLMRequest.ts | 78 +--- packages/xl-ai/src/api/LLMResponse.ts | 80 ++-- .../formats/html-blocks/htmlBlocks.test.ts | 9 +- .../api/formats/json/errorHandling.test.ts | 103 ++--- .../xl-ai/src/api/formats/json/json.test.ts | 9 +- .../api/formats/json/tools/jsontools.test.ts | 7 +- .../markdown-blocks/markdownBlocks.test.ts | 9 +- packages/xl-ai/src/index.ts | 5 + packages/xl-ai/src/streamTool/asTool.ts | 41 +- .../src/streamTool/callLLMWithStreamTools.ts | 402 ------------------ packages/xl-ai/src/streamTool/preprocess.ts | 4 + .../clientSideExecutor/clientSideExecutor.ts | 245 +++++++++++ .../dataStreamResponseToOperationsResult.ts | 50 +++ .../util/partialObjectStreamUtil.ts | 167 ++++++++ .../testUtil/cases/editors/blockFormatting.ts | 2 +- .../src/testUtil/cases/editors/emptyEditor.ts | 2 +- .../cases/editors/formattingAndMentions.ts | 2 +- .../testUtil/cases/editors/simpleEditor.ts | 4 +- .../src/testUtil/cases/editors/tables.ts | 2 +- .../cases/updateOperationTestCases.ts | 6 +- packages/xl-ai/src/util/stream.ts | 8 +- playground/src/examples.gen.tsx | 26 ++ pnpm-lock.yaml | 64 ++- 44 files changed, 1169 insertions(+), 670 deletions(-) create mode 100644 examples/09-ai/06-server-execution/.bnexample.json create mode 100644 examples/09-ai/06-server-execution/README.md create mode 100644 examples/09-ai/06-server-execution/index.html create mode 100644 examples/09-ai/06-server-execution/main.tsx create mode 100644 examples/09-ai/06-server-execution/package.json create mode 100644 examples/09-ai/06-server-execution/src/App.tsx create mode 100644 examples/09-ai/06-server-execution/src/getEnv.ts create mode 100644 examples/09-ai/06-server-execution/tsconfig.json create mode 100644 examples/09-ai/06-server-execution/vite.config.ts rename packages/xl-ai-server/src/{ => routes}/proxy.ts (100%) create mode 100644 packages/xl-ai-server/src/routes/vercelAiSdk.ts delete mode 100644 packages/xl-ai-server/src/vercelAISDK.ts delete mode 100644 packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts diff --git a/docs/package.json b/docs/package.json index 358bd32d45..d61f44e1aa 100644 --- a/docs/package.json +++ b/docs/package.json @@ -68,7 +68,7 @@ "@vercel/analytics": "^1.5.0", "@vercel/og": "^0.6.8", "@y-sweet/react": "^0.6.3", - "ai": "^4.1.0", + "ai": "^4.3.15", "babel-plugin-react-compiler": "19.1.0-rc.2", "better-auth": "^1.2.10", "better-sqlite3": "^11.10.0", diff --git a/examples/09-ai/01-minimal/src/App.tsx b/examples/09-ai/01-minimal/src/App.tsx index 5ba4ad4f2c..45b5412cc5 100644 --- a/examples/09-ai/01-minimal/src/App.tsx +++ b/examples/09-ai/01-minimal/src/App.tsx @@ -29,7 +29,7 @@ import { getEnv } from "./getEnv"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", }); // Use an "open" model such as llama, in this case via groq.com @@ -65,14 +65,6 @@ export default function App() { extensions: [ createAIExtension({ model, - /* - executor: (opts) => { - // fetch data - const resp = await fetch(opts) - // process to stream tool calls - const streamToolCalls = await yourLogicToConvertRespToStreamToolCalls(opts); - return LLMResponse.fromArray(opts.messages, opts.streamTools, streamToolCalls); - },*/ }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx index ffab193b04..fb72b587cf 100644 --- a/examples/09-ai/05-manual-execution/src/App.tsx +++ b/examples/09-ai/05-manual-execution/src/App.tsx @@ -22,7 +22,7 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - model: undefined as any, // disable model + executor: undefined as any, // disable }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/05-manual-execution/tsconfig.json b/examples/09-ai/05-manual-execution/tsconfig.json index 3b74ef215c..dbe3e6f62d 100644 --- a/examples/09-ai/05-manual-execution/tsconfig.json +++ b/examples/09-ai/05-manual-execution/tsconfig.json @@ -3,7 +3,11 @@ "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, - "lib": ["DOM", "DOM.Iterable", "ESNext"], + "lib": [ + "DOM", + "DOM.Iterable", + "ESNext" + ], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, @@ -18,16 +22,15 @@ "jsx": "react-jsx", "composite": true }, - "include": ["."], - "references": [ + "include": [ + "." + ], + "__ADD_FOR_LOCAL_DEV_references": [ { "path": "../../../packages/core/" }, { "path": "../../../packages/react/" - }, - { - "path": "../../../packages/xl-ai/" } ] -} +} \ No newline at end of file diff --git a/examples/09-ai/06-server-execution/.bnexample.json b/examples/09-ai/06-server-execution/.bnexample.json new file mode 100644 index 0000000000..b89a734a39 --- /dev/null +++ b/examples/09-ai/06-server-execution/.bnexample.json @@ -0,0 +1,12 @@ +{ + "playground": true, + "docs": true, + "author": "yousefed", + "tags": ["AI", "llm"], + "dependencies": { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "zustand": "^5.0.3" + } +} diff --git a/examples/09-ai/06-server-execution/README.md b/examples/09-ai/06-server-execution/README.md new file mode 100644 index 0000000000..867a30affa --- /dev/null +++ b/examples/09-ai/06-server-execution/README.md @@ -0,0 +1,3 @@ +# AI Integration with server LLM execution + +This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor diff --git a/examples/09-ai/06-server-execution/index.html b/examples/09-ai/06-server-execution/index.html new file mode 100644 index 0000000000..c2a78b33de --- /dev/null +++ b/examples/09-ai/06-server-execution/index.html @@ -0,0 +1,14 @@ + + + + + AI Integration with server LLM execution + + + +
+ + + diff --git a/examples/09-ai/06-server-execution/main.tsx b/examples/09-ai/06-server-execution/main.tsx new file mode 100644 index 0000000000..677c7f7eed --- /dev/null +++ b/examples/09-ai/06-server-execution/main.tsx @@ -0,0 +1,11 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import React from "react"; +import { createRoot } from "react-dom/client"; +import App from "./src/App.jsx"; + +const root = createRoot(document.getElementById("root")!); +root.render( + + + +); diff --git a/examples/09-ai/06-server-execution/package.json b/examples/09-ai/06-server-execution/package.json new file mode 100644 index 0000000000..e88ec02090 --- /dev/null +++ b/examples/09-ai/06-server-execution/package.json @@ -0,0 +1,31 @@ +{ + "name": "@blocknote/example-ai-server-execution", + "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "private": true, + "version": "0.12.4", + "scripts": { + "start": "vite", + "dev": "vite", + "build:prod": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@blocknote/core": "latest", + "@blocknote/react": "latest", + "@blocknote/ariakit": "latest", + "@blocknote/mantine": "latest", + "@blocknote/shadcn": "latest", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "zustand": "^5.0.3" + }, + "devDependencies": { + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "@vitejs/plugin-react": "^4.3.1", + "vite": "^5.3.4" + } +} \ No newline at end of file diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx new file mode 100644 index 0000000000..6b609aa554 --- /dev/null +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -0,0 +1,158 @@ +import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; +import "@blocknote/core/fonts/inter.css"; +import { en } from "@blocknote/core/locales"; +import { BlockNoteView } from "@blocknote/mantine"; +import "@blocknote/mantine/style.css"; +import { + FormattingToolbar, + FormattingToolbarController, + getDefaultReactSlashMenuItems, + getFormattingToolbarItems, + SuggestionMenuController, + useCreateBlockNote, +} from "@blocknote/react"; +import { + AIMenuController, + AIToolbarButton, + createAIExtension, + createStreamToolsArraySchema, + dataStreamResponseToOperationsResult, + getAISlashMenuItems, + LLMResponse, +} from "@blocknote/xl-ai"; +import { en as aiEn } from "@blocknote/xl-ai/locales"; +import "@blocknote/xl-ai/style.css"; + +import { getEnv } from "./getEnv"; + +const BASE_URL = + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || + "https://localhost:3000/ai/vercel-ai-sdk"; + +export default function App() { + // Creates a new editor instance. + const editor = useCreateBlockNote({ + dictionary: { + ...en, + ai: aiEn, // add default translations for the AI extension + }, + // Register the AI extension + extensions: [ + createAIExtension({ + // We define a custom executor that calls our backend server to execute LLM calls + // On the backend, we use the Vercel AI SDK to execute LLM calls + // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) + executor: async (opts) => { + const schema = createStreamToolsArraySchema(opts.streamTools); + + // Can also use /generateObject for non-streaming mode + const response = await fetch(`${BASE_URL}/streamObject`, { + method: "POST", + body: JSON.stringify({ + messages: opts.messages, + schema, + }), + }); + const parsedResponse = await dataStreamResponseToOperationsResult( + response, + opts.streamTools, + opts.onStart, + ); + return new LLMResponse( + opts.messages, + parsedResponse, + opts.streamTools, + ); + }, + }), + ], + // We set some initial content for demo purposes + initialContent: [ + { + type: "heading", + props: { + level: 1, + }, + content: "Open source software", + }, + { + type: "paragraph", + content: + "Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.", + }, + { + type: "paragraph", + content: + "One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.", + }, + { + type: "paragraph", + content: + "Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.", + }, + ], + }); + + // Renders the editor instance using a React component. + return ( +
+ + {/* Add the AI Command menu to the editor */} + + + {/* We disabled the default formatting toolbar with `formattingToolbar=false` + and replace it for one with an "AI button" (defined below). + (See "Formatting Toolbar" in docs) + */} + + + {/* We disabled the default SlashMenu with `slashMenu=false` + and replace it for one with an AI option (defined below). + (See "Suggestion Menus" in docs) + */} + + +
+ ); +} + +// Formatting toolbar with the `AIToolbarButton` added +function FormattingToolbarWithAI() { + return ( + ( + + {...getFormattingToolbarItems()} + {/* Add the AI button */} + + + )} + /> + ); +} + +// Slash menu with the AI option added +function SuggestionMenuWithAI(props: { + editor: BlockNoteEditor; +}) { + return ( + + filterSuggestionItems( + [ + ...getDefaultReactSlashMenuItems(props.editor), + // add the default AI slash menu items, or define your own + ...getAISlashMenuItems(props.editor), + ], + query, + ) + } + /> + ); +} diff --git a/examples/09-ai/06-server-execution/src/getEnv.ts b/examples/09-ai/06-server-execution/src/getEnv.ts new file mode 100644 index 0000000000..b225fc462e --- /dev/null +++ b/examples/09-ai/06-server-execution/src/getEnv.ts @@ -0,0 +1,20 @@ +// helper function to get env variables across next / vite +// only needed so this example works in BlockNote demos and docs +export function getEnv(key: string) { + const env = (import.meta as any).env + ? { + BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + } + : { + BLOCKNOTE_AI_SERVER_API_KEY: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + }; + + const value = env[key as keyof typeof env]; + return value; +} diff --git a/examples/09-ai/06-server-execution/tsconfig.json b/examples/09-ai/06-server-execution/tsconfig.json new file mode 100644 index 0000000000..3b74ef215c --- /dev/null +++ b/examples/09-ai/06-server-execution/tsconfig.json @@ -0,0 +1,33 @@ +{ + "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "composite": true + }, + "include": ["."], + "references": [ + { + "path": "../../../packages/core/" + }, + { + "path": "../../../packages/react/" + }, + { + "path": "../../../packages/xl-ai/" + } + ] +} diff --git a/examples/09-ai/06-server-execution/vite.config.ts b/examples/09-ai/06-server-execution/vite.config.ts new file mode 100644 index 0000000000..f62ab20bc2 --- /dev/null +++ b/examples/09-ai/06-server-execution/vite.config.ts @@ -0,0 +1,32 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import react from "@vitejs/plugin-react"; +import * as fs from "fs"; +import * as path from "path"; +import { defineConfig } from "vite"; +// import eslintPlugin from "vite-plugin-eslint"; +// https://vitejs.dev/config/ +export default defineConfig((conf) => ({ + plugins: [react()], + optimizeDeps: {}, + build: { + sourcemap: true, + }, + resolve: { + alias: + conf.command === "build" || + !fs.existsSync(path.resolve(__dirname, "../../packages/core/src")) + ? {} + : ({ + // Comment out the lines below to load a built version of blocknote + // or, keep as is to load live from sources with live reload working + "@blocknote/core": path.resolve( + __dirname, + "../../packages/core/src/" + ), + "@blocknote/react": path.resolve( + __dirname, + "../../packages/react/src/" + ), + } as any), + }, +})); diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index 4c7ec9aac2..4ca8540906 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -45,7 +45,9 @@ "dependencies": { "@hono/node-server": "^1.13.7", "hono": "^4.6.12", - "ai": "^4.3.19" + "ai": "^4", + "@blocknote/xl-ai": "workspace:*", + "@ai-sdk/openai": "^1.3.22" }, "devDependencies": { "eslint": "^8.10.0", diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts index bbef194464..2387be4c96 100644 --- a/packages/xl-ai-server/src/index.ts +++ b/packages/xl-ai-server/src/index.ts @@ -4,7 +4,8 @@ import { bearerAuth } from "hono/bearer-auth"; import { existsSync, readFileSync } from "node:fs"; import { createSecureServer } from "node:http2"; import { Agent, setGlobalDispatcher } from "undici"; -import { proxyRoute } from "./proxy"; +import { proxyRoute } from "./routes/proxy.js"; +import { vercelAiSdkRoute } from "./routes/vercelAiSdk.js"; // make sure our fetch request uses HTTP/2 setGlobalDispatcher( diff --git a/packages/xl-ai-server/src/proxy.ts b/packages/xl-ai-server/src/routes/proxy.ts similarity index 100% rename from packages/xl-ai-server/src/proxy.ts rename to packages/xl-ai-server/src/routes/proxy.ts diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts new file mode 100644 index 0000000000..acbbd4b391 --- /dev/null +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -0,0 +1,97 @@ +import { createOpenAI } from "@ai-sdk/openai"; +import { + objectToDataStream, + partialObjectStreamToDataStream, +} from "@blocknote/xl-ai"; +import { + generateObject, + generateText, + jsonSchema, + streamObject, + streamText, +} from "ai"; +import { Hono } from "hono"; +import { cors } from "hono/cors"; + +export const vercelAiSdkRoute = new Hono(); + +const model = createOpenAI({ + apiKey: process.env.OPENAI_API_KEY, +})("gpt-4-turbo"); + +// TODO: add support for generateText + tools +vercelAiSdkRoute.post("/generateText", cors(), async (c) => { + // TODO + const { messages } = await c.req.json(); + + const result = generateText({ + model, + messages, + tools: { + // add: tool({}), + }, + }); + + // return result.toDataStreamResponse(); +}); + +// TODO: add support for streamText + tools +vercelAiSdkRoute.post("/streamText", cors(), async (c) => { + // TODO + const { messages } = await c.req.json(); + + const result = streamText({ + model, + messages, + toolCallStreaming: true, + tools: { + // add: tool({}), + }, + }); + + return result.toDataStreamResponse(); +}); + +vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { + const { messages, schema } = await c.req.json(); + + const result = streamObject({ + model, + messages, + output: "object", + schema: jsonSchema(schema), + }); + + const dataStream = partialObjectStreamToDataStream(result.fullStream); + + return new Response(dataStream.pipeThrough(new TextEncoderStream()), { + status: 200, + statusText: "OK", + headers: { + contentType: "text/plain; charset=utf-8", + dataStreamVersion: "v1", + }, + }); +}); + +vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { + const { messages, schema } = await c.req.json(); + + const result = await generateObject({ + model, + messages, + output: "object", + schema: jsonSchema(schema), + }); + + const dataStream = objectToDataStream(result.object); + + return new Response(dataStream.pipeThrough(new TextEncoderStream()), { + status: 200, + statusText: "OK", + headers: { + contentType: "text/plain; charset=utf-8", + dataStreamVersion: "v1", + }, + }); +}); diff --git a/packages/xl-ai-server/src/vercelAISDK.ts b/packages/xl-ai-server/src/vercelAISDK.ts deleted file mode 100644 index e6cccc4570..0000000000 --- a/packages/xl-ai-server/src/vercelAISDK.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { openai } from "@ai-sdk/openai"; -import { streamObject, streamText, tool } from "ai"; -import { Hono } from "hono"; -import { cors } from "hono/cors"; - -export const vercelAiSdkRoute = new Hono(); - -vercelAiSdkRoute.post("/streamText", cors(), async (c) => { - const { messages } = await c.req.json(); - - const result = streamText({ - model: openai("gpt-4-turbo"), - system: "You are a helpful assistant.", - messages, - toolCallStreaming: true, - tools: { - add: tool({}), - }, - }); - - return result.toDataStreamResponse(); -}); - -vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { - const { messages } = await c.req.json(); - - const result = streamObject({ - model: openai("gpt-4-turbo"), - system: "You are a helpful assistant.", - messages, - - tools: { - add: tool({}), - }, - }); - - return result.toDataStreamResponse(); -}); diff --git a/packages/xl-ai-server/vite.config.ts b/packages/xl-ai-server/vite.config.ts index c2041c3105..a2aac2c75f 100644 --- a/packages/xl-ai-server/vite.config.ts +++ b/packages/xl-ai-server/vite.config.ts @@ -19,6 +19,7 @@ export default defineConfig((conf) => ({ : ({ // load live from sources with live reload working "@blocknote/core": path.resolve(__dirname, "../core/src/"), + "@blocknote/xl-ai": path.resolve(__dirname, "../xl-ai/src/"), } as Record), }, build: { diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index 5e45a18fca..08f97130a7 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -72,6 +72,7 @@ "@tiptap/core": "^2.12.0", "ai": "^4.3.19", "@ai-sdk/ui-utils": "^1.2.11", + "@ai-sdk/provider-utils": "^2.2.8", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", "prosemirror-model": "^1.24.1", diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 9922e23c7f..a5f12cd134 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -8,7 +8,7 @@ import { revertSuggestions, suggestChanges, } from "@blocknote/prosemirror-suggest-changes"; -import { APICallError, LanguageModel, RetryError } from "ai"; +import { APICallError, RetryError } from "ai"; import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; @@ -65,15 +65,6 @@ type AIPluginState = { * configuration options for LLM calls that are shared across all calls by default */ type GlobalLLMRequestOptions = { - /** - * The default language model to use for LLM calls - */ - model: LanguageModel; - /** - * Whether to stream the LLM response - * @default true - */ - stream?: boolean; /** * The default data format to use for LLM calls * html format is recommended, the other formats are experimental @@ -91,7 +82,7 @@ type GlobalLLMRequestOptions = { * Implement this function if you want to call a backend that is not compatible with * the Vercel AI SDK */ - executor?: (opts: ExecuteLLMRequestOptions) => Promise; + executor: (opts: ExecuteLLMRequestOptions) => Promise; }; const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`); @@ -123,10 +114,7 @@ export class AIExtension extends BlockNoteExtension { public readonly options: ReturnType< ReturnType< typeof createStore< - MakeOptional< - Required, - "promptBuilder" | "executor" - > + MakeOptional, "promptBuilder"> > > >; @@ -148,10 +136,7 @@ export class AIExtension extends BlockNoteExtension { super(); this.options = createStore< - MakeOptional< - Required, - "promptBuilder" | "executor" - > + MakeOptional, "promptBuilder"> >()((_set) => ({ dataFormat: llmFormats.html, stream: true, @@ -365,7 +350,7 @@ export class AIExtension extends BlockNoteExtension { /** * Execute a call to an LLM and apply the result to the editor */ - public async callLLM(opts: MakeOptional) { + public async callLLM(opts: MakeOptional) { this.setAIResponseStatus("thinking"); this.editor.forkYDocPlugin?.fork(); diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index d96c577567..006e9d5028 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,6 +1,5 @@ import { BlockNoteEditor } from "@blocknote/core"; -import { CoreMessage, generateObject, LanguageModelV1, streamObject } from "ai"; -import { createAISDKLLMRequestExecutor } from "../streamTool/callLLMWithStreamTools.js"; +import { CoreMessage } from "ai"; import { StreamTool } from "../streamTool/streamTool.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; @@ -14,27 +13,18 @@ type MakeOptional = Omit & Partial>; export type ExecuteLLMRequestOptions = { messages: CoreMessage[]; streamTools: StreamTool[]; + // TODO: needed? llmRequestOptions: MakeOptional; onStart?: () => void; }; export type LLMRequestOptions = { - /** - * The language model to use for the LLM call (AI SDK) - * - * (when invoking `callLLM` via the `AIExtension` this will default to the - * model set in the `AIExtension` options) - * - * Note: perhaps we want to remove this - */ - model?: LanguageModelV1; - /** * Customize how your LLM backend is called. * Implement this function if you want to call a backend that is not compatible with * the Vercel AI SDK */ - executor?: (opts: ExecuteLLMRequestOptions) => Promise; + executor: (opts: ExecuteLLMRequestOptions) => Promise; /** * The user prompt to use for the LLM call @@ -105,36 +95,6 @@ export type LLMRequestOptions = { * @default true */ withDelays?: boolean; - - // The settings below might make more sense to be part of the executor - - /** - * Whether to stream the LLM response or not - * - * When streaming, we use the AI SDK `streamObject` function, - * otherwise, we use the AI SDK `generateObject` function. - * - * @default true - */ - stream?: boolean; - - /** - * The maximum number of retries for the LLM call - * - * @default 2 - */ - maxRetries?: number; - - /** - * Additional options to pass to the AI SDK `generateObject` function - * (only used when `stream` is `false`) - */ - _generateObjectOptions?: Partial>[0]>; - /** - * Additional options to pass to the AI SDK `streamObject` function - * (only used when `stream` is `true`) - */ - _streamObjectOptions?: Partial>[0]>; }; /** @@ -152,16 +112,13 @@ export async function doLLMRequest( userPrompt, useSelection, deleteEmptyCursorBlock, - stream, onStart, withDelays, dataFormat, previousResponse, ...rest } = { - maxRetries: 2, deleteEmptyCursorBlock: true, - stream: true, withDelays: true, dataFormat: htmlBlockLLMFormat, ...opts, @@ -214,14 +171,15 @@ export async function doLLMRequest( For now, this approach works ok. */ - previousMessages.push({ - role: "system", // using "assistant" here doesn't work with gemini because we can't mix system / assistant messages - content: - "ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call: \n" + - JSON.stringify( - await previousResponse.llmResult.getGeneratedOperations(), - ), - }); + // TODO: fix + // previousMessages.push({ + // role: "system", // using "assistant" here doesn't work with gemini because we can't mix system / assistant messages + // content: + // "ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call: \n" + + // JSON.stringify( + // await previousResponse.llmResult.getGeneratedOperations(), + // ), + // }); } const messages = await promptBuilder(editor, { @@ -241,14 +199,9 @@ export async function doLLMRequest( opts.onBlockUpdate, ); - let executor = opts.executor; - if (!executor) { - if (!opts.model) { - throw new Error("model is required when no executor is provided"); - } - executor = createAISDKLLMRequestExecutor({ model: opts.model }); - } - return executor({ + // TODO: design decision, does it make sense to pass `messages` here, or should creating the message array + // be the responsibility of the executor / server, and should we pass editor state instead? + return opts.executor({ onStart: () => { if (deleteCursorBlock) { editor.removeBlocks([deleteCursorBlock]); @@ -260,7 +213,6 @@ export async function doLLMRequest( llmRequestOptions: { ...opts, ...rest, - stream, }, }); } diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts index d9905e4edb..7dcfc73501 100644 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -1,11 +1,35 @@ import { CoreMessage } from "ai"; -import { OperationsResult } from "../streamTool/callLLMWithStreamTools.js"; import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; import { StreamToolExecutor } from "../streamTool/StreamToolExecutor.js"; -import { createAsyncIterableStreamFromAsyncIterable } from "../util/stream.js"; +import { AsyncIterableStream } from "../util/stream.js"; + +/** + * Result of an LLM call with stream tools + */ +export type OperationsResult[]> = + AsyncIterableStream<{ + /** + * The operation the LLM wants to execute + */ + operation: StreamToolCall; + /** + * Whether {@link operation} is an update to the previous operation in the stream. + * + * For non-streaming mode, this will always be `false` + */ + isUpdateToPreviousOperation: boolean; + /** + * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) + * + * For non-streaming mode, this will always be `false` + */ + isPossiblyPartial: boolean; + }>; /** * Result of an LLM call with stream tools that apply changes to a BlockNote Editor + * + * TODO: maybe get rid of this class? */ export class LLMResponse { /** @@ -32,59 +56,25 @@ export class LLMResponse { */ public async execute() { const executor = new StreamToolExecutor(this.streamTools); - await executor.execute(this.llmResult.operationsSource); + await executor.execute(this.llmResult); await executor.waitTillEnd(); } /** * @internal + * + * TODO */ public async _logToolCalls() { - for await (const toolCall of this.llmResult.operationsSource) { + for await (const toolCall of this.llmResult) { // eslint-disable-next-line no-console console.log(JSON.stringify(toolCall, null, 2)); } } - - /** - * Create a LLMResponse from an array of operations. - * - * Note: This is a temporary helper, we'll make it easier to create this from streaming data if required - */ - public static fromArray[]>( - messages: CoreMessage[], - streamTools: StreamTool[], - operations: StreamToolCall[], - ): LLMResponse { - return new LLMResponse( - messages, - OperationsResultFromArray(operations), - streamTools, - ); - } } -function OperationsResultFromArray[]>( - operations: StreamToolCall[], -): OperationsResult { - async function* singleChunkGenerator() { - for (const op of operations) { - yield { - operation: op, - isUpdateToPreviousOperation: false, - isPossiblyPartial: false, - }; - } - } - - return { - streamObjectResult: undefined, - generateObjectResult: undefined, - get operationsSource() { - return createAsyncIterableStreamFromAsyncIterable(singleChunkGenerator()); - }, - async getGeneratedOperations() { - return { operations }; - }, - }; -} +// TODO +// async getGeneratedOperations() { +// return { operations }; +// }, +// } diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index aafb57b6ad..236a2fd144 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -3,6 +3,7 @@ import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; @@ -125,10 +126,12 @@ describe("Models", () => { doLLMRequest(editor, { ...options, dataFormat: htmlBlockLLMFormat, - model: params.model, - maxRetries: 0, - stream: params.stream, withDelays: false, + executor: createAISDKLLMRequestExecutor({ + model: params.model, + stream: params.stream, + maxRetries: 0, + }), }), // TODO: remove when matthew's parsing PR is merged { diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index 5edee6b452..a47b7e8b0a 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -5,6 +5,7 @@ import { BlockNoteEditor } from "@blocknote/core"; import { HttpResponse, http } from "msw"; import { setupServer } from "msw/node"; import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { jsonLLMFormat } from "./json.js"; @@ -35,60 +36,64 @@ describe("Error handling", () => { errorServer.resetHandlers(); }); - it("handles 429 Too Many Requests error", async () => { - // Set up handler for this specific test - errorServer.use( - http.post("*", () => { - return new HttpResponse( - JSON.stringify({ - error: { - message: "Rate limit exceeded, please try again later", - type: "rate_limit_exceeded", - code: "rate_limit_exceeded", + [{ stream: true }, { stream: false }].forEach(({ stream }) => { + it(`handles 429 Too Many Requests error ${stream ? "streaming" : "non-streaming"}`, async () => { + // Set up handler for this specific test + errorServer.use( + http.post("*", () => { + return new HttpResponse( + JSON.stringify({ + error: { + message: "Rate limit exceeded, please try again later", + type: "rate_limit_exceeded", + code: "rate_limit_exceeded", + }, + }), + { + status: 429, + headers: { + "Content-Type": "application/json", + }, }, - }), + ); + }), + ); + + const editor = BlockNoteEditor.create({ + initialContent: [ { - status: 429, - headers: { - "Content-Type": "application/json", - }, + type: "paragraph", + content: "Hello world", }, - ); - }), - ); - - const editor = BlockNoteEditor.create({ - initialContent: [ - { - type: "paragraph", - content: "Hello world", - }, - ], - }); + ], + }); - // Use a flag to track if an error was thrown - let errorThrown = false; - let caughtError: any = null; + // Use a flag to track if an error was thrown + let errorThrown = false; + let caughtError: any = null; - try { - const result = await doLLMRequest(editor, { - stream: true, - userPrompt: "translate to Spanish", - model: openai, - maxRetries: 0, - dataFormat: jsonLLMFormat, - }); - await result.execute(); - } catch (error: any) { - errorThrown = true; - caughtError = error; - } + try { + const result = await doLLMRequest(editor, { + userPrompt: "translate to Spanish", + executor: createAISDKLLMRequestExecutor({ + model: openai, + maxRetries: 0, + stream, + }), + dataFormat: jsonLLMFormat, + }); + await result.execute(); + } catch (error: any) { + errorThrown = true; + caughtError = error; + } - // Assertions outside the try/catch - expect(errorThrown).toBe(true); - expect(caughtError).toBeDefined(); - expect(caughtError.message || caughtError.toString()).toContain( - "Rate limit exceeded, please try again later", - ); + // Assertions outside the try/catch + expect(errorThrown).toBe(true); + expect(caughtError).toBeDefined(); + expect(caughtError.message || caughtError.toString()).toContain( + "Rate limit exceeded, please try again later", + ); + }); }); }); diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts index 16abc26e43..b6034264ae 100644 --- a/packages/xl-ai/src/api/formats/json/json.test.ts +++ b/packages/xl-ai/src/api/formats/json/json.test.ts @@ -6,6 +6,7 @@ import { setupServer } from "msw/node"; import path from "path"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { jsonLLMFormat } from "./json.js"; @@ -115,9 +116,11 @@ describe.skip("Models", () => { generateSharedTestCases((editor, options) => doLLMRequest(editor, { ...options, - stream: params.stream, - model: params.model, - maxRetries: 0, + executor: createAISDKLLMRequestExecutor({ + model: params.model, + maxRetries: 0, + stream: params.stream, + }), withDelays: false, dataFormat: jsonLLMFormat, }), diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts index ad7ee80d35..30210a743a 100644 --- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts +++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts @@ -59,12 +59,7 @@ async function executeTestCase( // bit hacky way to instantiate an LLMResponse just so we can call execute const result = new LLMResponse( undefined as any, - { - operationsSource: createAsyncIterableStreamFromAsyncIterable(stream), - streamObjectResult: undefined, - generateObjectResult: undefined, - getGeneratedOperations: undefined as any, - }, + createAsyncIterableStreamFromAsyncIterable(stream), streamTools, ); diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts index 4bb89079f6..ddcefc7a80 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts @@ -4,6 +4,7 @@ import { getCurrentTest } from "@vitest/runner"; import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; @@ -114,9 +115,11 @@ describe("Models", () => { (editor, options) => doLLMRequest(editor, { ...options, - model: params.model, - maxRetries: 0, - stream: params.stream, + executor: createAISDKLLMRequestExecutor({ + model: params.model, + maxRetries: 0, + stream: params.stream, + }), withDelays: false, dataFormat: markdownBlocksLLMFormat, // _generateObjectOptions: { diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts index c002ac5418..685d059609 100644 --- a/packages/xl-ai/src/index.ts +++ b/packages/xl-ai/src/index.ts @@ -13,4 +13,9 @@ export * from "./components/SuggestionMenu/getAISlashMenuItems.js"; export * from "./i18n/dictionary.js"; export * from "./api/index.js"; + +// TODO: organize these exports: +export * from "./streamTool/jsonSchema.js"; export * from "./streamTool/StreamToolExecutor.js"; +export * from "./streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.js"; +export * from "./streamTool/vercelAiSdk/util/partialObjectStreamUtil.js"; diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts index f1f18fc44e..2cd9e1d018 100644 --- a/packages/xl-ai/src/streamTool/asTool.ts +++ b/packages/xl-ai/src/streamTool/asTool.ts @@ -1,7 +1,6 @@ import { jsonSchema, tool } from "ai"; -import { operationsToStream } from "./callLLMWithStreamTools.js"; import { createStreamToolsArraySchema } from "./jsonSchema.js"; -import { StreamTool } from "./streamTool.js"; +import { Result, StreamTool, StreamToolCall } from "./streamTool.js"; // TODO: remove or implement @@ -42,3 +41,41 @@ export function streamToolsAsTool[]>(streamTools: T) { }, }); } + +// TODO: review +function operationsToStream[]>( + object: unknown, +): Result< + AsyncIterable<{ + partialOperation: StreamToolCall; + isUpdateToPreviousOperation: boolean; + isPossiblyPartial: boolean; + }> +> { + if ( + !object || + typeof object !== "object" || + !("operations" in object) || + !Array.isArray(object.operations) + ) { + return { + ok: false, + error: "No operations returned", + }; + } + const operations = object.operations; + async function* singleChunkGenerator() { + for (const op of operations) { + yield { + partialOperation: op, + isUpdateToPreviousOperation: false, + isPossiblyPartial: false, + }; + } + } + + return { + ok: true, + value: singleChunkGenerator(), + }; +} diff --git a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts b/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts deleted file mode 100644 index 57636e0fd6..0000000000 --- a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts +++ /dev/null @@ -1,402 +0,0 @@ -import { - CoreMessage, - GenerateObjectResult, - LanguageModel, - LanguageModelV1, - ObjectStreamPart, - StreamObjectResult, - generateObject, - jsonSchema, - streamObject, -} from "ai"; - -import { createStreamToolsArraySchema } from "./jsonSchema.js"; - -import { ExecuteLLMRequestOptions } from "../api/LLMRequest.js"; -import { LLMResponse } from "../api/LLMResponse.js"; -import { - AsyncIterableStream, - createAsyncIterableStream, - createAsyncIterableStreamFromAsyncIterable, -} from "../util/stream.js"; -import { filterNewOrUpdatedOperations } from "./filterNewOrUpdatedOperations.js"; -import { - preprocessOperationsNonStreaming, - preprocessOperationsStreaming, -} from "./preprocess.js"; -import { Result, StreamTool, StreamToolCall } from "./streamTool.js"; - -type LLMRequestOptions = { - model: LanguageModel; - messages: CoreMessage[]; - maxRetries: number; -}; - -/** - * Result of an LLM call with stream tools - */ -export type OperationsResult[]> = { - /** - * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode - */ - streamObjectResult: StreamObjectResult | undefined; - /** - * Result of the underlying `generateObject` (AI SDK) call, or `undefined` if streaming mode - */ - generateObjectResult: GenerateObjectResult | undefined; - /** - * Stream of tool call operations, these are the operations the LLM "decided" to execute - * - * Calling this consumes the underlying streams - */ - operationsSource: AsyncIterableStream<{ - /** - * The operation the LLM wants to execute - */ - operation: StreamToolCall; - /** - * Whether {@link operation} is an update to the previous operation in the stream. - * - * For non-streaming mode, this will always be `false` - */ - isUpdateToPreviousOperation: boolean; - /** - * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) - * - * For non-streaming mode, this will always be `false` - */ - isPossiblyPartial: boolean; - }>; - /** - * All tool call operations the LLM decided to execute - */ - getGeneratedOperations: () => Promise<{ - operations: StreamToolCall[]; - }>; -}; - -/** - * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK. - * - * This is the non-streaming version. - */ -export async function generateOperations[]>( - streamTools: T, - opts: LLMRequestOptions & { - _generateObjectOptions?: Partial>[0]>; - }, -): Promise> { - const { _generateObjectOptions, ...rest } = opts; - - if ( - _generateObjectOptions && - ("output" in _generateObjectOptions || "schema" in _generateObjectOptions) - ) { - throw new Error( - "Cannot provide output or schema in _generateObjectOptions", - ); - } - - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); - const options = { - // non-overridable options for streamObject - output: "object" as const, - schema, - - // configurable options for streamObject - - // - optional, with defaults - - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - rest.model.provider === "mistral.chat" || - rest.model.provider === "google.generative-ai" - ? "auto" - : "tool", - // - mandatory ones: - ...rest, - - // extra options for streamObject - ...((_generateObjectOptions ?? {}) as any), - }; - - const ret = await generateObject<{ operations: any }>(options); - - // because the rest of the codebase always expects a stream, we convert the object to a stream here - const stream = operationsToStream(ret.object); - - if (!stream.ok) { - throw new Error(stream.error); - } - - let _operationsSource: OperationsResult["operationsSource"]; - - return { - streamObjectResult: undefined, - generateObjectResult: ret, - get operationsSource() { - if (!_operationsSource) { - _operationsSource = createAsyncIterableStreamFromAsyncIterable( - preprocessOperationsNonStreaming(stream.value, streamTools), - ); - } - return _operationsSource; - }, - async getGeneratedOperations() { - return ret.object; - }, - }; -} - -export function operationsToStream[]>( - object: unknown, -): Result< - AsyncIterable<{ - partialOperation: StreamToolCall; - isUpdateToPreviousOperation: boolean; - isPossiblyPartial: boolean; - }> -> { - if ( - !object || - typeof object !== "object" || - !("operations" in object) || - !Array.isArray(object.operations) - ) { - return { - ok: false, - error: "No operations returned", - }; - } - const operations = object.operations; - async function* singleChunkGenerator() { - for (const op of operations) { - yield { - partialOperation: op, - isUpdateToPreviousOperation: false, - isPossiblyPartial: false, - }; - } - } - - return { - ok: true, - value: singleChunkGenerator(), - }; -} - -/** - * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK. - * - * This is the streaming version. - */ -export async function streamOperations[]>( - streamTools: T, - opts: LLMRequestOptions & { - _streamObjectOptions?: Partial< - Parameters>[0] - >; - }, - onStart: () => void = () => { - // noop - }, -): Promise> { - const { _streamObjectOptions, ...rest } = opts; - - if ( - _streamObjectOptions && - ("output" in _streamObjectOptions || "schema" in _streamObjectOptions) - ) { - throw new Error("Cannot provide output or schema in _streamObjectOptions"); - } - - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); - - const options = { - // non-overridable options for streamObject - output: "object" as const, - schema, - // configurable options for streamObject - - // - optional, with defaults - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - rest.model.provider === "mistral.chat" || - rest.model.provider === "google.generative-ai" - ? "auto" - : "tool", - // - mandatory ones: - ...rest, - - // extra options for streamObject - ...((opts._streamObjectOptions ?? {}) as any), - }; - - const ret = streamObject<{ operations: any }>(options); - - let _operationsSource: OperationsResult["operationsSource"]; - - const [fullStream1, fullStream2] = ret.fullStream.tee(); - - // Always consume fullStream2 in the background and store the last operations - const allOperationsPromise = (async () => { - let lastOperations: { operations: StreamToolCall[] } = { - operations: [], - }; - const objectStream = createAsyncIterableStream( - partialObjectStream(fullStream2), - ); - - for await (const chunk of objectStream) { - if (chunk && typeof chunk === "object" && "operations" in chunk) { - lastOperations = chunk as any; - } - } - return lastOperations; - })(); - - // Note: we can probably clean this up by switching to streams instead of async iterables - return { - streamObjectResult: ret, - generateObjectResult: undefined, - get operationsSource() { - if (!_operationsSource) { - _operationsSource = createAsyncIterableStreamFromAsyncIterable( - preprocessOperationsStreaming( - filterNewOrUpdatedOperations( - streamOnStartCallback( - partialObjectStreamThrowError( - createAsyncIterableStream(fullStream1), - ), - onStart, - ), - ), - streamTools, - ), - ); - } - return _operationsSource; - }, - async getGeneratedOperations() { - // Simply return the stored operations - // If the stream hasn't completed yet, this will return the latest available operations - return allOperationsPromise; - }, - }; -} - -async function* streamOnStartCallback( - stream: AsyncIterable, - onStart: () => void, -): AsyncIterable { - let first = true; - for await (const chunk of stream) { - if (first) { - onStart(); - first = false; - } - yield chunk; - } -} - -// adapted from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 -// change made to throw errors (with the original they're silently ignored) -function partialObjectStreamThrowError( - stream: ReadableStream>, -): AsyncIterableStream { - return createAsyncIterableStream( - stream.pipeThrough( - new TransformStream, PARTIAL>({ - transform(chunk, controller) { - switch (chunk.type) { - case "object": - controller.enqueue(chunk.object); - break; - - case "text-delta": - case "finish": - break; - case "error": - controller.error(chunk.error); - break; - default: { - const _exhaustiveCheck: never = chunk; - throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); - } - } - }, - }), - ), - ); -} - -// from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 -function partialObjectStream( - stream: ReadableStream>, -): AsyncIterableStream { - return createAsyncIterableStream( - stream.pipeThrough( - new TransformStream, PARTIAL>({ - transform(chunk, controller) { - switch (chunk.type) { - case "object": - controller.enqueue(chunk.object); - break; - case "text-delta": - case "finish": - break; - case "error": - break; - default: { - const _exhaustiveCheck: never = chunk; - throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); - } - } - }, - }), - ), - ); -} - -export function createAISDKLLMRequestExecutor(opts: { - model: LanguageModelV1; -}) { - const { model } = opts; - return async (opts: ExecuteLLMRequestOptions) => { - const { messages, streamTools, llmRequestOptions, onStart } = opts; - const { stream, maxRetries, _generateObjectOptions, _streamObjectOptions } = - llmRequestOptions; - let response: - | Awaited>> - | Awaited>>; - - if (stream) { - response = await streamOperations( - streamTools, - { - messages, - model, - maxRetries, - ...(_streamObjectOptions as any), - }, - onStart, - ); - } else { - response = await generateOperations(streamTools, { - messages, - model, - maxRetries, - ...(_generateObjectOptions as any), - }); - onStart?.(); - } - - return new LLMResponse(messages, response, streamTools); - }; -} diff --git a/packages/xl-ai/src/streamTool/preprocess.ts b/packages/xl-ai/src/streamTool/preprocess.ts index 0a98ecc216..71cba2d567 100644 --- a/packages/xl-ai/src/streamTool/preprocess.ts +++ b/packages/xl-ai/src/streamTool/preprocess.ts @@ -43,6 +43,10 @@ export async function* preprocessOperationsStreaming< /** * Validates an stream of operations and throws an error if an invalid operation is found. + * + * TODO: remove + * + * @deprecated */ export async function* preprocessOperationsNonStreaming< T extends StreamTool[], diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts new file mode 100644 index 0000000000..5466cce309 --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts @@ -0,0 +1,245 @@ +import { + CoreMessage, + LanguageModel, + LanguageModelV1, + generateObject, + jsonSchema, + streamObject, +} from "ai"; + +import { ExecuteLLMRequestOptions } from "../../../api/LLMRequest.js"; +import { LLMResponse } from "../../../api/LLMResponse.js"; +import { createStreamToolsArraySchema } from "../../jsonSchema.js"; +import { StreamTool } from "../../streamTool.js"; +import { dataStreamResponseToOperationsResult } from "../util/dataStreamResponseToOperationsResult.js"; +import { + objectToDataStream, + partialObjectStreamToDataStream, +} from "../util/partialObjectStreamUtil.js"; + +type LLMRequestOptions = { + model: LanguageModel; + messages: CoreMessage[]; + maxRetries: number; +}; + +/** + * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK. + * + * This is the non-streaming version. + */ +export async function generateOperations[]>( + streamTools: T, + opts: LLMRequestOptions & { + _generateObjectOptions?: Partial>[0]>; + }, +) { + const { _generateObjectOptions, ...rest } = opts; + + if ( + _generateObjectOptions && + ("output" in _generateObjectOptions || "schema" in _generateObjectOptions) + ) { + throw new Error( + "Cannot provide output or schema in _generateObjectOptions", + ); + } + + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + const options = { + // non-overridable options for streamObject + output: "object" as const, + schema, + + // configurable options for streamObject + + // - optional, with defaults + + // mistral somehow needs "auto", while groq/llama needs "tool" + // google needs "auto" because https://github.com/vercel/ai/issues/6959 + // TODO: further research this and / or make configurable + // for now stick to "tool" by default as this has been tested mostly + mode: + rest.model.provider === "mistral.chat" || + rest.model.provider === "google.generative-ai" + ? "auto" + : "tool", + // - mandatory ones: + ...rest, + + // extra options for streamObject + ...((_generateObjectOptions ?? {}) as any), + }; + + const ret = await generateObject<{ operations: any }>(options); + + const stream = objectToDataStream(ret.object); + + return { + dataStreamResponse: new Response( + stream.pipeThrough(new TextEncoderStream()), + { + status: 200, + statusText: "OK", + headers: { + contentType: "text/plain; charset=utf-8", + dataStreamVersion: "v1", + }, + }, + ), + /** + * Result of the underlying `generateObject` (AI SDK) call, or `undefined` if streaming mode + */ + generateObjectResult: ret, + }; +} + +/** + * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK. + * + * This is the streaming version. + */ +export async function streamOperations[]>( + streamTools: T, + opts: LLMRequestOptions & { + _streamObjectOptions?: Partial< + Parameters>[0] + >; + }, +) { + const { _streamObjectOptions, ...rest } = opts; + + if ( + _streamObjectOptions && + ("output" in _streamObjectOptions || "schema" in _streamObjectOptions) + ) { + throw new Error("Cannot provide output or schema in _streamObjectOptions"); + } + + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + + const options = { + // non-overridable options for streamObject + output: "object" as const, + schema, + // configurable options for streamObject + + // - optional, with defaults + // mistral somehow needs "auto", while groq/llama needs "tool" + // google needs "auto" because https://github.com/vercel/ai/issues/6959 + // TODO: further research this and / or make configurable + // for now stick to "tool" by default as this has been tested mostly + mode: + rest.model.provider === "mistral.chat" || + rest.model.provider === "google.generative-ai" + ? "auto" + : "tool", + // - mandatory ones: + ...rest, + + // extra options for streamObject + ...((opts._streamObjectOptions ?? {}) as any), + }; + + const ret = streamObject<{ operations: any }>(options); + + // Transform the partial object stream to a data stream format + const stream = partialObjectStreamToDataStream(ret.fullStream); + + return { + dataStreamResponse: new Response( + stream.pipeThrough(new TextEncoderStream()), + { + status: 200, + statusText: "OK", + headers: { + contentType: "text/plain; charset=utf-8", + dataStreamVersion: "v1", + }, + }, + ), + /** + * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode + */ + streamObjectResult: ret, + }; +} + +export function createAISDKLLMRequestExecutor(opts: { + /** + * The language model to use for the LLM call (AI SDK) + * + * (when invoking `callLLM` via the `AIExtension` this will default to the + * model set in the `AIExtension` options) + * + * Note: perhaps we want to remove this + */ + model: LanguageModelV1; + + /** + * Whether to stream the LLM response or not + * + * When streaming, we use the AI SDK `streamObject` function, + * otherwise, we use the AI SDK `generateObject` function. + * + * @default true + */ + stream?: boolean; + + /** + * The maximum number of retries for the LLM call + * + * @default 2 + */ + maxRetries?: number; + + /** + * Additional options to pass to the AI SDK `generateObject` function + * (only used when `stream` is `false`) + */ + _generateObjectOptions?: Partial>[0]>; + /** + * Additional options to pass to the AI SDK `streamObject` function + * (only used when `stream` is `true`) + */ + _streamObjectOptions?: Partial>[0]>; +}) { + const { + model, + stream, + maxRetries, + _generateObjectOptions, + _streamObjectOptions, + } = opts; + return async (opts: ExecuteLLMRequestOptions) => { + const { messages, streamTools, onStart } = opts; + + // TODO: add support for streamText / generateText and tool calls + + let response: // | Awaited>> + Awaited>>; + + if (stream) { + response = await streamOperations(streamTools, { + messages, + model, + maxRetries, + ...(_streamObjectOptions as any), + }); + } else { + response = (await generateOperations(streamTools, { + messages, + model, + maxRetries, + ...(_generateObjectOptions as any), + })) as any; + } + + const parsedResponse = await dataStreamResponseToOperationsResult( + response.dataStreamResponse, + streamTools, + onStart, + ); + return new LLMResponse(messages, parsedResponse, streamTools); + }; +} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts new file mode 100644 index 0000000000..fa75e30fee --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts @@ -0,0 +1,50 @@ +import { OperationsResult } from "../../../api/LLMResponse.js"; +import { + createAsyncIterableStream, + createAsyncIterableStreamFromAsyncIterable, +} from "../../../util/stream.js"; +import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations.js"; +import { preprocessOperationsStreaming } from "../../preprocess.js"; +import { StreamTool, StreamToolCall } from "../../streamTool.js"; +import { + dataStreamToTextStream, + textStreamToPartialObjectStream, +} from "./partialObjectStreamUtil.js"; + +export async function dataStreamResponseToOperationsResult< + T extends StreamTool[], +>( + response: Response, + streamTools: T, + onStart: () => void = () => { + // noop + }, +): Promise> { + const ret = dataStreamToTextStream(response.body!).pipeThrough( + textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), + ); + + // Note: we can probably clean this up by switching to streams instead of async iterables + return createAsyncIterableStreamFromAsyncIterable( + preprocessOperationsStreaming( + filterNewOrUpdatedOperations( + streamOnStartCallback(createAsyncIterableStream(ret), onStart), + ), + streamTools, + ), + ); +} + +async function* streamOnStartCallback( + stream: AsyncIterable, + onStart: () => void, +): AsyncIterable { + let first = true; + for await (const chunk of stream) { + if (first) { + onStart(); + first = false; + } + yield chunk; + } +} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts new file mode 100644 index 0000000000..0d53e83645 --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -0,0 +1,167 @@ +import { getErrorMessage } from "@ai-sdk/provider-utils"; +import { + formatDataStreamPart, + isDeepEqualData, + parsePartialJson, + processDataStream, +} from "@ai-sdk/ui-utils"; +import { DeepPartial, ObjectStreamPart } from "ai"; +import { + AsyncIterableStream, + createAsyncIterableStream, +} from "../../../util/stream.js"; + +// adapted from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 +// change made to throw errors (with the original they're silently ignored) +export function partialObjectStreamThrowError_UNUSED( + stream: ReadableStream>, +): AsyncIterableStream { + return createAsyncIterableStream( + stream.pipeThrough( + new TransformStream, PARTIAL>({ + transform(chunk, controller) { + switch (chunk.type) { + case "object": + controller.enqueue(chunk.object); + break; + + case "text-delta": + case "finish": + break; + case "error": + controller.error(chunk.error); + break; + default: { + const _exhaustiveCheck: never = chunk; + throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); + } + } + }, + }), + ), + ); +} + +// from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 +export function partialObjectStream_UNUSED( + stream: ReadableStream>, +): AsyncIterableStream { + return createAsyncIterableStream( + stream.pipeThrough( + new TransformStream, PARTIAL>({ + transform(chunk, controller) { + switch (chunk.type) { + case "object": + controller.enqueue(chunk.object); + break; + case "text-delta": + case "finish": + break; + case "error": + break; + default: { + const _exhaustiveCheck: never = chunk; + throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); + } + } + }, + }), + ), + ); +} + +// based on https://github.com/vercel/ai/blob/d383c37072a91dfd0cebac13893dea044d9f88fa/packages/react/src/use-object.ts#L185 +export function textStreamToPartialObjectStream() { + let accumulatedText = ""; + let latestObject: DeepPartial | undefined = undefined; + return new TransformStream>({ + transform(chunk, controller) { + accumulatedText += chunk; + const { value } = parsePartialJson(accumulatedText); + const currentObject = value as DeepPartial; + + if (!isDeepEqualData(latestObject, currentObject)) { + latestObject = currentObject; + + controller.enqueue(currentObject); + } + }, + }); +} + +export function dataStreamToTextStream(stream: ReadableStream) { + let errored = false; + const textStream = new ReadableStream({ + start(controller) { + processDataStream({ + stream, + onTextPart: (chunk) => { + controller.enqueue(chunk); + }, + onErrorPart: (chunk) => { + errored = true; + controller.error(chunk); + // console.log("error", chunk); + }, + }).then( + () => { + if (!errored) { + controller.close(); + } + }, + (error) => { + controller.error(error); + }, + ); + }, + }); + return textStream; +} + +/** + * Transforms a partial object stream to a data stream format. + * This is needed to pass errors through to the client in a clean way. + * + * @param stream - The partial object stream to transform + * @returns A ReadableStream that emits data stream formatted chunks + * + * @see https://github.com/vercel/ai/issues/5027#issuecomment-2701011869 + * @see https://github.com/vercel/ai/issues/5115 + */ +export function partialObjectStreamToDataStream( + stream: ReadableStream>, +): ReadableStream { + return stream.pipeThrough( + new TransformStream({ + transform(chunk, controller) { + switch (chunk.type) { + case "text-delta": + controller.enqueue(formatDataStreamPart("text", chunk.textDelta)); + break; + case "object": + case "finish": + break; + case "error": + controller.enqueue( + formatDataStreamPart("error", getErrorMessage(chunk.error)), + ); + break; + default: { + const _exhaustiveCheck: never = chunk; + throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); + } + } + }, + }), + ); +} + +export function objectToDataStream(object: any) { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(formatDataStreamPart("text", JSON.stringify(object))); + controller.close(); + }, + }); + return stream; +} diff --git a/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts b/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts index 90ec7580f3..01bf9d44ff 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts @@ -24,7 +24,7 @@ export function getEditorWithBlockFormatting() { schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts b/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts index 144cb722e3..92bd606871 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts @@ -12,7 +12,7 @@ export function getEmptyEditor() { trailingBlock: false, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts b/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts index 77478cce3f..dc22e839d7 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts @@ -74,7 +74,7 @@ export function getEditorWithFormattingAndMentions() { schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts b/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts index e3bea4dab1..8776c340d4 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts @@ -18,7 +18,7 @@ export function getSimpleEditor() { schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, }), ], }); @@ -46,7 +46,7 @@ export function getSimpleEditorWithCursorBetweenBlocks() { schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/testUtil/cases/editors/tables.ts b/packages/xl-ai/src/testUtil/cases/editors/tables.ts index f67dcbb810..cf4f5d853a 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/tables.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/tables.ts @@ -40,7 +40,7 @@ export function getEditorWithTables() { trailingBlock: false, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts index 0d7f0f4dcb..9292c27ac6 100644 --- a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts +++ b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts @@ -685,7 +685,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); @@ -742,7 +742,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); @@ -781,7 +781,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ schema, extensions: [ createAIExtension({ - model: undefined as any, + executor: undefined as any, // disable }), ], }); diff --git a/packages/xl-ai/src/util/stream.ts b/packages/xl-ai/src/util/stream.ts index 03ac85c234..ee130c52b1 100644 --- a/packages/xl-ai/src/util/stream.ts +++ b/packages/xl-ai/src/util/stream.ts @@ -2,7 +2,7 @@ * Converts an AsyncIterable to a ReadableStream */ export function asyncIterableToStream( - iterable: AsyncIterable + iterable: AsyncIterable, ): ReadableStream { return new ReadableStream({ async start(controller) { @@ -29,11 +29,11 @@ export type AsyncIterableStream = AsyncIterable & ReadableStream; * Creates an AsyncIterableStream from a ReadableStream */ export function createAsyncIterableStream( - source: ReadableStream + source: ReadableStream, ): AsyncIterableStream { if (source.locked) { throw new Error( - "Stream (source) is already locked and cannot be iterated." + "Stream (source) is already locked and cannot be iterated.", ); } @@ -60,7 +60,7 @@ export function createAsyncIterableStream( * Creates an AsyncIterableStream from an AsyncGenerator */ export function createAsyncIterableStreamFromAsyncIterable( - source: AsyncIterable + source: AsyncIterable, ): AsyncIterableStream { return createAsyncIterableStream(asyncIterableToStream(source)); } diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 4cb9ee6d4e..7c0f24710c 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1680,6 +1680,32 @@ "slug": "ai" }, "readme": "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor" + }, + { + "projectSlug": "server-execution", + "fullSlug": "ai/server-execution", + "pathFromRoot": "examples/09-ai/06-server-execution", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^4.3.15", + "zustand": "^5.0.3" + } as any + }, + "title": "AI Integration with server LLM execution", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor" } ] }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9074a77a33..ef1729579c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -225,8 +225,8 @@ importers: specifier: ^0.6.3 version: 0.6.4(react@19.1.0)(yjs@13.6.27) ai: - specifier: ^4.1.0 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^4.3.15 + version: 4.3.19(react@19.1.0)(zod@3.25.76) babel-plugin-react-compiler: specifier: 19.1.0-rc.2 version: 19.1.0-rc.2 @@ -3361,6 +3361,55 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/09-ai/06-server-execution: + dependencies: + '@blocknote/ariakit': + specifier: latest + version: link:../../../packages/ariakit + '@blocknote/core': + specifier: latest + version: link:../../../packages/core + '@blocknote/mantine': + specifier: latest + version: link:../../../packages/mantine + '@blocknote/react': + specifier: latest + version: link:../../../packages/react + '@blocknote/shadcn': + specifier: latest + version: link:../../../packages/shadcn + '@blocknote/xl-ai': + specifier: latest + version: link:../../../packages/xl-ai + '@mantine/core': + specifier: ^7.17.3 + version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + ai: + specifier: ^4.3.15 + version: 4.3.19(react@19.1.0)(zod@3.25.76) + react: + specifier: ^19.1.0 + version: 19.1.0 + react-dom: + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) + zustand: + specifier: ^5.0.3 + version: 5.0.3(@types/react@19.1.8)(immer@10.1.1)(react@19.1.0)(use-sync-external-store@1.5.0(react@19.1.0)) + devDependencies: + '@types/react': + specifier: ^19.1.0 + version: 19.1.8 + '@types/react-dom': + specifier: ^19.1.0 + version: 19.1.6(@types/react@19.1.8) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.4.1(vite@5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1)) + vite: + specifier: ^5.3.4 + version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.43.1) + examples/vanilla-js/react-vanilla-custom-blocks: dependencies: '@blocknote/ariakit': @@ -4070,6 +4119,9 @@ importers: packages/xl-ai: dependencies: + '@ai-sdk/provider-utils': + specifier: ^2.2.8 + version: 2.2.8(zod@3.25.76) '@ai-sdk/ui-utils': specifier: ^1.2.11 version: 1.2.11(zod@3.25.76) @@ -4227,11 +4279,17 @@ importers: packages/xl-ai-server: dependencies: + '@ai-sdk/openai': + specifier: ^1.3.22 + version: 1.3.22(zod@3.25.76) + '@blocknote/xl-ai': + specifier: workspace:* + version: link:../xl-ai '@hono/node-server': specifier: ^1.13.7 version: 1.14.0(hono@4.7.5) ai: - specifier: ^4.3.19 + specifier: ^4 version: 4.3.19(react@19.1.0)(zod@3.25.76) hono: specifier: ^4.6.12 From b737ae52e81868adc15ce336867d309bad5df4a1 Mon Sep 17 00:00:00 2001 From: yousefed Date: Mon, 4 Aug 2025 08:57:10 +0200 Subject: [PATCH 08/68] fix lint --- packages/xl-ai-server/src/routes/vercelAiSdk.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index acbbd4b391..e5af965228 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -32,6 +32,7 @@ vercelAiSdkRoute.post("/generateText", cors(), async (c) => { }, }); + return result as any; // return result.toDataStreamResponse(); }); From 75dcf10ad9e2b738a2d7c104e2adf6e7ff3625c0 Mon Sep 17 00:00:00 2001 From: yousefed Date: Mon, 4 Aug 2025 09:05:42 +0200 Subject: [PATCH 09/68] fix build --- examples/09-ai/01-minimal/src/App.tsx | 2 +- examples/09-ai/02-playground/src/App.tsx | 15 ++++++++------- .../09-ai/03-custom-ai-menu-items/src/App.tsx | 2 +- examples/09-ai/04-with-collaboration/src/App.tsx | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/09-ai/01-minimal/src/App.tsx b/examples/09-ai/01-minimal/src/App.tsx index 45b5412cc5..725ee99779 100644 --- a/examples/09-ai/01-minimal/src/App.tsx +++ b/examples/09-ai/01-minimal/src/App.tsx @@ -64,7 +64,7 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - model, + executor: model as any, // TODO }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index a739a8d026..e0621fccf5 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -31,7 +31,6 @@ import { import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; import { Fieldset, MantineProvider, Switch } from "@mantine/core"; -import { LanguageModelV1 } from "ai"; import { useEffect, useMemo, useState } from "react"; import { useStore } from "zustand"; @@ -101,7 +100,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - model: model as LanguageModelV1, // (type because initially it's valid) + executor: model as any, // TODO + // model: model as LanguageModelV1, // (type because initially it's valid) }), ], // We set some initial content for demo purposes @@ -136,13 +136,13 @@ export default function App() { useEffect(() => { // update the default model in the extension if (model !== "unknown-model") { - ai.options.setState({ model }); + ai.options.setState({ executor: model as any }); // TODO } }, [model, ai.options]); const [dataFormat, setDataFormat] = useState("html"); - const stream = useStore(ai.options, (state) => state.stream); + const stream = useStore(ai.options, (state: any) => state.stream); // TODO const themePreference = usePrefersColorScheme(); const existingContext = useBlockNoteContext(); @@ -196,9 +196,10 @@ export default function App() { - ai.options.setState({ stream: e.target.checked }) - } + onChange={(e) => { + // TODO + // ai.options.setState({ stream: e.target.checked }) + }} label="Streaming" /> diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index 2b4b5e9d57..b01e25a3ba 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -67,7 +67,7 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - model, + executor: model as any, // TODO }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index 2d42fc3ec7..081571bba8 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -109,7 +109,7 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - model, + executor: model as any, // TODO }), ], // We set some initial content for demo purposes From ad9d7aa18a7bc0c76ebda22065862819c84e64b3 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 11:35:31 +0200 Subject: [PATCH 10/68] package upgrades --- docs/package.json | 16 +- examples/09-ai/01-minimal/.bnexample.json | 4 +- examples/09-ai/01-minimal/package.json | 6 +- examples/09-ai/02-playground/.bnexample.json | 14 +- examples/09-ai/02-playground/package.json | 16 +- .../03-custom-ai-menu-items/.bnexample.json | 4 +- .../03-custom-ai-menu-items/package.json | 6 +- .../04-with-collaboration/.bnexample.json | 4 +- .../09-ai/04-with-collaboration/package.json | 6 +- .../09-ai/05-manual-execution/.bnexample.json | 4 +- .../09-ai/05-manual-execution/package.json | 6 +- .../09-ai/06-server-execution/.bnexample.json | 2 +- .../09-ai/06-server-execution/package.json | 4 +- packages/xl-ai-server/package.json | 4 +- packages/xl-ai/package.json | 16 +- playground/package.json | 14 +- playground/src/examples.gen.tsx | 2999 ++++++++--------- pnpm-lock.yaml | 293 +- 18 files changed, 1681 insertions(+), 1737 deletions(-) diff --git a/docs/package.json b/docs/package.json index d61f44e1aa..20e683548d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,12 +13,12 @@ "test": "node validate-links.js" }, "dependencies": { - "@ai-sdk/anthropic": "^1.2.11", - "@ai-sdk/google": "^1.2.20", - "@ai-sdk/groq": "^1.1.0", - "@ai-sdk/mistral": "^1.2.8", - "@ai-sdk/openai": "^1.1.0", - "@ai-sdk/openai-compatible": "^0.2.14", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/mistral": "^2.0.12", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", "@aws-sdk/client-s3": "^3.609.0", "@aws-sdk/s3-request-presigner": "^3.609.0", "@blocknote/code-block": "latest", @@ -68,7 +68,7 @@ "@vercel/analytics": "^1.5.0", "@vercel/og": "^0.6.8", "@y-sweet/react": "^0.6.3", - "ai": "^4.3.15", + "ai": "^5.0.29", "babel-plugin-react-compiler": "19.1.0-rc.2", "better-auth": "^1.2.10", "better-sqlite3": "^11.10.0", @@ -138,4 +138,4 @@ "y-partykit": "^0.0.33", "yjs": "^13.6.27" } -} \ No newline at end of file +} diff --git a/examples/09-ai/01-minimal/.bnexample.json b/examples/09-ai/01-minimal/.bnexample.json index 6de9d7b5bd..c3e9db3c7e 100644 --- a/examples/09-ai/01-minimal/.bnexample.json +++ b/examples/09-ai/01-minimal/.bnexample.json @@ -6,8 +6,8 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/01-minimal/package.json b/examples/09-ai/01-minimal/package.json index 4a93e90a01..0fefad75bd 100644 --- a/examples/09-ai/01-minimal/package.json +++ b/examples/09-ai/01-minimal/package.json @@ -19,8 +19,8 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" }, "devDependencies": { @@ -29,4 +29,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/examples/09-ai/02-playground/.bnexample.json b/examples/09-ai/02-playground/.bnexample.json index 2e467271da..9713832f15 100644 --- a/examples/09-ai/02-playground/.bnexample.json +++ b/examples/09-ai/02-playground/.bnexample.json @@ -6,13 +6,13 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/google": "^1.2.20", - "@ai-sdk/openai": "^1.3.22", - "@ai-sdk/openai-compatible": "^0.2.14", - "@ai-sdk/groq": "^1.2.9", - "@ai-sdk/anthropic": "^1.2.11", - "@ai-sdk/mistral": "^1.2.8", + "ai": "^5.0.29", + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/mistral": "^2.0.12", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/02-playground/package.json b/examples/09-ai/02-playground/package.json index f852c5da96..133afe0a4d 100644 --- a/examples/09-ai/02-playground/package.json +++ b/examples/09-ai/02-playground/package.json @@ -19,13 +19,13 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/google": "^1.2.20", - "@ai-sdk/openai": "^1.3.22", - "@ai-sdk/openai-compatible": "^0.2.14", - "@ai-sdk/groq": "^1.2.9", - "@ai-sdk/anthropic": "^1.2.11", - "@ai-sdk/mistral": "^1.2.8", + "ai": "^5.0.29", + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/mistral": "^2.0.12", "zustand": "^5.0.3" }, "devDependencies": { @@ -34,4 +34,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json index 23355c91be..96eee14a8f 100644 --- a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json +++ b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json @@ -7,8 +7,8 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^4.1.0", - "@ai-sdk/openai": "^1.1.0", - "@ai-sdk/groq": "^1.1.0", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", "zustand": "^5.0.3" } diff --git a/examples/09-ai/03-custom-ai-menu-items/package.json b/examples/09-ai/03-custom-ai-menu-items/package.json index b347bcc3c7..0ae67658ad 100644 --- a/examples/09-ai/03-custom-ai-menu-items/package.json +++ b/examples/09-ai/03-custom-ai-menu-items/package.json @@ -20,8 +20,8 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^4.1.0", - "@ai-sdk/openai": "^1.1.0", - "@ai-sdk/groq": "^1.1.0", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", "zustand": "^5.0.3" }, @@ -31,4 +31,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/examples/09-ai/04-with-collaboration/.bnexample.json b/examples/09-ai/04-with-collaboration/.bnexample.json index fe40994365..86d7b0b93e 100644 --- a/examples/09-ai/04-with-collaboration/.bnexample.json +++ b/examples/09-ai/04-with-collaboration/.bnexample.json @@ -6,8 +6,8 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" diff --git a/examples/09-ai/04-with-collaboration/package.json b/examples/09-ai/04-with-collaboration/package.json index 782e4ce5a5..39b786c35d 100644 --- a/examples/09-ai/04-with-collaboration/package.json +++ b/examples/09-ai/04-with-collaboration/package.json @@ -19,8 +19,8 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" @@ -31,4 +31,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/examples/09-ai/05-manual-execution/.bnexample.json b/examples/09-ai/05-manual-execution/.bnexample.json index 6f21dbcd55..b68b0f7eaf 100644 --- a/examples/09-ai/05-manual-execution/.bnexample.json +++ b/examples/09-ai/05-manual-execution/.bnexample.json @@ -6,8 +6,8 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" diff --git a/examples/09-ai/05-manual-execution/package.json b/examples/09-ai/05-manual-execution/package.json index f47382c37e..5befab19b3 100644 --- a/examples/09-ai/05-manual-execution/package.json +++ b/examples/09-ai/05-manual-execution/package.json @@ -19,8 +19,8 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + "ai": "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" @@ -31,4 +31,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/examples/09-ai/06-server-execution/.bnexample.json b/examples/09-ai/06-server-execution/.bnexample.json index b89a734a39..2e6914912b 100644 --- a/examples/09-ai/06-server-execution/.bnexample.json +++ b/examples/09-ai/06-server-execution/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", + "ai": "^5.0.29", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/06-server-execution/package.json b/examples/09-ai/06-server-execution/package.json index e88ec02090..929ff45187 100644 --- a/examples/09-ai/06-server-execution/package.json +++ b/examples/09-ai/06-server-execution/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", + "ai": "^5.0.29", "zustand": "^5.0.3" }, "devDependencies": { @@ -28,4 +28,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} \ No newline at end of file +} diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index 4ca8540906..88289325c0 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -45,9 +45,9 @@ "dependencies": { "@hono/node-server": "^1.13.7", "hono": "^4.6.12", - "ai": "^4", + "ai": "^5.0.29", "@blocknote/xl-ai": "workspace:*", - "@ai-sdk/openai": "^1.3.22" + "@ai-sdk/openai": "^2.0.23" }, "devDependencies": { "eslint": "^8.10.0", diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index 08f97130a7..ea123569ca 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -70,9 +70,9 @@ "@blocknote/react": "0.35.0", "@floating-ui/react": "^0.26.4", "@tiptap/core": "^2.12.0", - "ai": "^4.3.19", + "ai": "^5.0.29", "@ai-sdk/ui-utils": "^1.2.11", - "@ai-sdk/provider-utils": "^2.2.8", + "@ai-sdk/provider-utils": "^3.0.7", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", "prosemirror-model": "^1.24.1", @@ -90,12 +90,12 @@ "zustand": "^5.0.3" }, "devDependencies": { - "@ai-sdk/groq": "^1.2.9", - "@ai-sdk/mistral": "^1.2.8", - "@ai-sdk/openai": "^1.3.22", - "@ai-sdk/openai-compatible": "^0.2.14", - "@ai-sdk/anthropic": "^1.2.12", - "@ai-sdk/google": "^1.2.20", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/mistral": "^2.0.12", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/google": "^2.0.11", "@mswjs/interceptors": "^0.37.5", "@types/diff": "^6.0.0", "@types/json-diff": "^1.0.3", diff --git a/playground/package.json b/playground/package.json index 3cb49d1236..ddb3823ce6 100644 --- a/playground/package.json +++ b/playground/package.json @@ -11,12 +11,12 @@ "clean": "rimraf dist" }, "dependencies": { - "@ai-sdk/anthropic": "^1.2.11", - "@ai-sdk/google": "^1.2.20", - "@ai-sdk/groq": "^1.2.9", - "@ai-sdk/mistral": "^1.2.8", - "@ai-sdk/openai": "^1.3.22", - "@ai-sdk/openai-compatible": "^0.2.14", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/mistral": "^2.0.12", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", "@aws-sdk/client-s3": "^3.609.0", "@aws-sdk/s3-request-presigner": "^3.609.0", "@blocknote/ariakit": "workspace:^", @@ -54,7 +54,7 @@ "@uppy/webcam": "^3.4.2", "@uppy/xhr-upload": "^3.4.0", "@y-sweet/react": "^0.6.3", - "ai": "^4.3.15", + "ai": "^5.0.29", "autoprefixer": "10.4.21", "docx": "^9.0.2", "react": "^19.1.0", diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 7c0f24710c..560652e84c 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1,613 +1,586 @@ // generated by dev-scripts/examples/gen.ts - export const examples = { - "basic": { - "pathFromRoot": "examples/01-basic", - "slug": "basic", - "projects": [ - { - "projectSlug": "minimal", - "fullSlug": "basic/minimal", - "pathFromRoot": "examples/01-basic/01-minimal", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic" - ] - }, - "title": "Basic Setup", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example shows the minimal code required to set up a BlockNote editor in React.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "block-objects", - "fullSlug": "basic/block-objects", - "pathFromRoot": "examples/01-basic/02-block-objects", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic", - "Blocks", - "Inline Content" - ] - }, - "title": "Displaying Document JSON", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "In this example, the document's JSON representation is displayed below the editor.\n\n**Try it out:** Try typing in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Document Structure](/docs/foundations/document-structure)\n- [Getting the Document](/docs/reference/editor/manipulating-content)" - }, - { - "projectSlug": "multi-column", - "fullSlug": "basic/multi-column", - "pathFromRoot": "examples/01-basic/03-multi-column", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic", - "Blocks" - ], - "dependencies": { - "@blocknote/xl-multi-column": "latest" +export const examples = { + basic: { + pathFromRoot: "examples/01-basic", + slug: "basic", + projects: [ + { + projectSlug: "minimal", + fullSlug: "basic/minimal", + pathFromRoot: "examples/01-basic/01-minimal", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic"], + }, + title: "Basic Setup", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example shows the minimal code required to set up a BlockNote editor in React.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "block-objects", + fullSlug: "basic/block-objects", + pathFromRoot: "examples/01-basic/02-block-objects", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic", "Blocks", "Inline Content"], + }, + title: "Displaying Document JSON", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "In this example, the document's JSON representation is displayed below the editor.\n\n**Try it out:** Try typing in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Document Structure](/docs/foundations/document-structure)\n- [Getting the Document](/docs/reference/editor/manipulating-content)", + }, + { + projectSlug: "multi-column", + fullSlug: "basic/multi-column", + pathFromRoot: "examples/01-basic/03-multi-column", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic", "Blocks"], + dependencies: { + "@blocknote/xl-multi-column": "latest", } as any, - "pro": true - }, - "title": "Multi-Column Blocks", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example showcases multi-column blocks, allowing you to stack blocks next to each other. These come as part of the `@blocknote/xl-multi-column` package.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)" - }, - { - "projectSlug": "default-blocks", - "fullSlug": "basic/default-blocks", - "pathFromRoot": "examples/01-basic/04-default-blocks", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic", - "Blocks", - "Inline Content" - ] - }, - "title": "Default Schema Showcase", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example showcases each block and inline content type in BlockNote's default schema.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)\n- [Default Schema](/docs/foundations/schemas)" - }, - { - "projectSlug": "removing-default-blocks", - "fullSlug": "basic/removing-default-blocks", - "pathFromRoot": "examples/01-basic/05-removing-default-blocks", - "config": { - "playground": true, - "docs": true, - "author": "hunxjunedo", - "tags": [ - "Basic", - "removing", - "blocks" - ] - }, - "title": "Removing Default Blocks from Schema", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example shows how to change the default schema and disable the Audio and Image blocks. To do this, we pass in a custom schema based on the built-in, default schema, with two specific blocks removed.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schemas](/docs/features/custom-schemas)\n- [Default Schema](/docs/foundations/schemas)" - }, - { - "projectSlug": "block-manipulation", - "fullSlug": "basic/block-manipulation", - "pathFromRoot": "examples/01-basic/06-block-manipulation", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Blocks" - ] - }, - "title": "Manipulating Blocks", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example shows 4 buttons to manipulate the first block using the `insertBlocks`, `updateBlock`, `removeBlocks` and `replaceBlocks` methods.\n\n**Relevant Docs:**\n\n- [Block Manipulation](/docs/reference/editor/manipulating-content)" - }, - { - "projectSlug": "selection-blocks", - "fullSlug": "basic/selection-blocks", - "pathFromRoot": "examples/01-basic/07-selection-blocks", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Blocks" - ] - }, - "title": "Displaying Selected Blocks", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "In this example, the JSON representation of blocks spanned by the user's selection, is displayed below the editor.\n\n**Try it out:** Select different blocks in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Cursor Selections](/docs/reference/editor/cursor-selections)" - }, - { - "projectSlug": "ariakit", - "fullSlug": "basic/ariakit", - "pathFromRoot": "examples/01-basic/08-ariakit", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic" - ] - }, - "title": "Use with Ariakit", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example shows how you can use BlockNote with Ariakit (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Ariakit Docs](/docs/getting-started/ariakit)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "shadcn", - "fullSlug": "basic/shadcn", - "pathFromRoot": "examples/01-basic/09-shadcn", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic" - ] - }, - "title": "Use with ShadCN", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example shows how you can use BlockNote with ShadCN (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Getting Started with ShadCN](/docs/getting-started/shadcn)" - }, - { - "projectSlug": "localization", - "fullSlug": "basic/localization", - "pathFromRoot": "examples/01-basic/10-localization", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic" - ] - }, - "title": "Localization (i18n)", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "In this example, we pass in a custom dictionary to change the interface of the editor to use Dutch (NL) strings.\n\nYou can also provide your own dictionary to customize the strings used in the editor, or submit a Pull Request to add support for your language of your choice.\n\n**Relevant Docs:**\n\n- [Localization](/docs/features/localization)" - }, - { - "projectSlug": "custom-placeholder", - "fullSlug": "basic/custom-placeholder", - "pathFromRoot": "examples/01-basic/11-custom-placeholder", - "config": { - "playground": true, - "docs": true, - "author": "ezhil56x", - "tags": [ - "Basic" - ] - }, - "title": "Change placeholder text", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "In this example, we show how to change the placeholders:\n\n- For an empty document, we show a placeholder `Start typing..` (by default, this is not set)\n- the default placeholder in this editor shows `Custom default placeholder` instead of the default (`Enter text or type '/' for commands`)\n- for Headings, the placeholder shows `Custom heading placeholder` instead of the default (`Heading`). Try adding a Heading to see the change\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Localization (i18n)](/examples/basic/localization)" - }, - { - "projectSlug": "multi-editor", - "fullSlug": "basic/multi-editor", - "pathFromRoot": "examples/01-basic/12-multi-editor", - "config": { - "playground": true, - "docs": true, - "author": "areknawo", - "tags": [ - "Basic" - ] - }, - "title": "Multi-Editor Setup", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example showcases use of multiple editors in a single page - you can even drag blocks between them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "custom-paste-handler", - "fullSlug": "basic/custom-paste-handler", - "pathFromRoot": "examples/01-basic/13-custom-paste-handler", - "config": { - "playground": true, - "docs": true, - "author": "nperez0111", - "tags": [ - "Basic" - ] - }, - "title": "Custom Paste Handler", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "In this example, we change the default paste handler to append some text to the pasted content when the content is plain text.\n\n**Try it out:** Use the buttons to copy some content to the clipboard and paste it in the editor to trigger our custom paste handler.\n\n**Relevant Docs:**\n\n- [Paste Handling](/docs/reference/editor/paste-handling)" - }, - { - "projectSlug": "testing", - "fullSlug": "basic/testing", - "pathFromRoot": "examples/01-basic/testing", - "config": { - "playground": true, - "docs": false - }, - "title": "Test Editor", - "group": { - "pathFromRoot": "examples/01-basic", - "slug": "basic" - }, - "readme": "This example is meant for use in end-to-end tests." - } - ] + pro: true, + }, + title: "Multi-Column Blocks", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example showcases multi-column blocks, allowing you to stack blocks next to each other. These come as part of the `@blocknote/xl-multi-column` package.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)", + }, + { + projectSlug: "default-blocks", + fullSlug: "basic/default-blocks", + pathFromRoot: "examples/01-basic/04-default-blocks", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic", "Blocks", "Inline Content"], + }, + title: "Default Schema Showcase", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example showcases each block and inline content type in BlockNote's default schema.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)\n- [Default Schema](/docs/foundations/schemas)", + }, + { + projectSlug: "removing-default-blocks", + fullSlug: "basic/removing-default-blocks", + pathFromRoot: "examples/01-basic/05-removing-default-blocks", + config: { + playground: true, + docs: true, + author: "hunxjunedo", + tags: ["Basic", "removing", "blocks"], + }, + title: "Removing Default Blocks from Schema", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example shows how to change the default schema and disable the Audio and Image blocks. To do this, we pass in a custom schema based on the built-in, default schema, with two specific blocks removed.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schemas](/docs/features/custom-schemas)\n- [Default Schema](/docs/foundations/schemas)", + }, + { + projectSlug: "block-manipulation", + fullSlug: "basic/block-manipulation", + pathFromRoot: "examples/01-basic/06-block-manipulation", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Blocks"], + }, + title: "Manipulating Blocks", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example shows 4 buttons to manipulate the first block using the `insertBlocks`, `updateBlock`, `removeBlocks` and `replaceBlocks` methods.\n\n**Relevant Docs:**\n\n- [Block Manipulation](/docs/reference/editor/manipulating-content)", + }, + { + projectSlug: "selection-blocks", + fullSlug: "basic/selection-blocks", + pathFromRoot: "examples/01-basic/07-selection-blocks", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Blocks"], + }, + title: "Displaying Selected Blocks", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "In this example, the JSON representation of blocks spanned by the user's selection, is displayed below the editor.\n\n**Try it out:** Select different blocks in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Cursor Selections](/docs/reference/editor/cursor-selections)", + }, + { + projectSlug: "ariakit", + fullSlug: "basic/ariakit", + pathFromRoot: "examples/01-basic/08-ariakit", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic"], + }, + title: "Use with Ariakit", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example shows how you can use BlockNote with Ariakit (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Ariakit Docs](/docs/getting-started/ariakit)\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "shadcn", + fullSlug: "basic/shadcn", + pathFromRoot: "examples/01-basic/09-shadcn", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic"], + }, + title: "Use with ShadCN", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example shows how you can use BlockNote with ShadCN (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Getting Started with ShadCN](/docs/getting-started/shadcn)", + }, + { + projectSlug: "localization", + fullSlug: "basic/localization", + pathFromRoot: "examples/01-basic/10-localization", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic"], + }, + title: "Localization (i18n)", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "In this example, we pass in a custom dictionary to change the interface of the editor to use Dutch (NL) strings.\n\nYou can also provide your own dictionary to customize the strings used in the editor, or submit a Pull Request to add support for your language of your choice.\n\n**Relevant Docs:**\n\n- [Localization](/docs/features/localization)", + }, + { + projectSlug: "custom-placeholder", + fullSlug: "basic/custom-placeholder", + pathFromRoot: "examples/01-basic/11-custom-placeholder", + config: { + playground: true, + docs: true, + author: "ezhil56x", + tags: ["Basic"], + }, + title: "Change placeholder text", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "In this example, we show how to change the placeholders:\n\n- For an empty document, we show a placeholder `Start typing..` (by default, this is not set)\n- the default placeholder in this editor shows `Custom default placeholder` instead of the default (`Enter text or type '/' for commands`)\n- for Headings, the placeholder shows `Custom heading placeholder` instead of the default (`Heading`). Try adding a Heading to see the change\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Localization (i18n)](/examples/basic/localization)", + }, + { + projectSlug: "multi-editor", + fullSlug: "basic/multi-editor", + pathFromRoot: "examples/01-basic/12-multi-editor", + config: { + playground: true, + docs: true, + author: "areknawo", + tags: ["Basic"], + }, + title: "Multi-Editor Setup", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "This example showcases use of multiple editors in a single page - you can even drag blocks between them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "custom-paste-handler", + fullSlug: "basic/custom-paste-handler", + pathFromRoot: "examples/01-basic/13-custom-paste-handler", + config: { + playground: true, + docs: true, + author: "nperez0111", + tags: ["Basic"], + }, + title: "Custom Paste Handler", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: + "In this example, we change the default paste handler to append some text to the pasted content when the content is plain text.\n\n**Try it out:** Use the buttons to copy some content to the clipboard and paste it in the editor to trigger our custom paste handler.\n\n**Relevant Docs:**\n\n- [Paste Handling](/docs/reference/editor/paste-handling)", + }, + { + projectSlug: "testing", + fullSlug: "basic/testing", + pathFromRoot: "examples/01-basic/testing", + config: { + playground: true, + docs: false, + }, + title: "Test Editor", + group: { + pathFromRoot: "examples/01-basic", + slug: "basic", + }, + readme: "This example is meant for use in end-to-end tests.", + }, + ], }, - "backend": { - "pathFromRoot": "examples/02-backend", - "slug": "backend", - "projects": [ - { - "projectSlug": "file-uploading", - "fullSlug": "backend/file-uploading", - "pathFromRoot": "examples/02-backend/01-file-uploading", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Intermediate", - "Saving/Loading" - ] - }, - "title": "Upload Files", - "group": { - "pathFromRoot": "examples/02-backend", - "slug": "backend" - }, - "readme": "This example allows users to upload files and use them in the editor. The files are uploaded to [/TMP/Files](https://tmpfiles.org/), and can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the \"Add Image\" button and see there's now an \"Upload\" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)" - }, - { - "projectSlug": "saving-loading", - "fullSlug": "backend/saving-loading", - "pathFromRoot": "examples/02-backend/02-saving-loading", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Intermediate", - "Blocks", - "Saving/Loading" - ] - }, - "title": "Saving & Loading", - "group": { - "pathFromRoot": "examples/02-backend", - "slug": "backend" - }, - "readme": "This example shows how to save the editor contents to local storage whenever a change is made, and load the saved contents when the editor is created.\n\nYou can replace the `saveToStorage` and `loadFromStorage` functions with calls to your backend or database.\n\n**Try it out:** Try typing in the editor and reloading the page!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Getting the Document](/docs/foundations/manipulating-content#reading-blocks)" - }, - { - "projectSlug": "s3", - "fullSlug": "backend/s3", - "pathFromRoot": "examples/02-backend/03-s3", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Intermediate", - "Saving/Loading" - ], - "dependencies": { + backend: { + pathFromRoot: "examples/02-backend", + slug: "backend", + projects: [ + { + projectSlug: "file-uploading", + fullSlug: "backend/file-uploading", + pathFromRoot: "examples/02-backend/01-file-uploading", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Intermediate", "Saving/Loading"], + }, + title: "Upload Files", + group: { + pathFromRoot: "examples/02-backend", + slug: "backend", + }, + readme: + 'This example allows users to upload files and use them in the editor. The files are uploaded to [/TMP/Files](https://tmpfiles.org/), and can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the "Add Image" button and see there\'s now an "Upload" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)', + }, + { + projectSlug: "saving-loading", + fullSlug: "backend/saving-loading", + pathFromRoot: "examples/02-backend/02-saving-loading", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Intermediate", "Blocks", "Saving/Loading"], + }, + title: "Saving & Loading", + group: { + pathFromRoot: "examples/02-backend", + slug: "backend", + }, + readme: + "This example shows how to save the editor contents to local storage whenever a change is made, and load the saved contents when the editor is created.\n\nYou can replace the `saveToStorage` and `loadFromStorage` functions with calls to your backend or database.\n\n**Try it out:** Try typing in the editor and reloading the page!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Getting the Document](/docs/foundations/manipulating-content#reading-blocks)", + }, + { + projectSlug: "s3", + fullSlug: "backend/s3", + pathFromRoot: "examples/02-backend/03-s3", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Intermediate", "Saving/Loading"], + dependencies: { "@aws-sdk/client-s3": "^3.609.0", - "@aws-sdk/s3-request-presigner": "^3.609.0" + "@aws-sdk/s3-request-presigner": "^3.609.0", + } as any, + pro: true, + }, + title: "Upload Files to AWS S3", + group: { + pathFromRoot: "examples/02-backend", + slug: "backend", + }, + readme: + 'This example allows users to upload files to an AWS S3 bucket and use them in the editor. The files can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the "Add Image" button and see there\'s now an "Upload" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)', + }, + { + projectSlug: "rendering-static-documents", + fullSlug: "backend/rendering-static-documents", + pathFromRoot: "examples/02-backend/04-rendering-static-documents", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["server"], + dependencies: { + "@blocknote/server-util": "latest", } as any, - "pro": true }, - "title": "Upload Files to AWS S3", - "group": { - "pathFromRoot": "examples/02-backend", - "slug": "backend" + title: "Rendering static documents", + group: { + pathFromRoot: "examples/02-backend", + slug: "backend", }, - "readme": "This example allows users to upload files to an AWS S3 bucket and use them in the editor. The files can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the \"Add Image\" button and see there's now an \"Upload\" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)" + readme: + "This example shows how you can use HTML exported using the `blocksToFullHTML` and render it as a static document (a view-only document, without the editor). You can use this for example if you use BlockNote to edit blog posts in a CMS, but want to display non-editable static, published pages to end-users.\n\n**Relevant Docs:**\n\n- [Server-side processing](/docs/features/server-processing)", }, - { - "projectSlug": "rendering-static-documents", - "fullSlug": "backend/rendering-static-documents", - "pathFromRoot": "examples/02-backend/04-rendering-static-documents", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "server" - ], - "dependencies": { - "@blocknote/server-util": "latest" - } as any - }, - "title": "Rendering static documents", - "group": { - "pathFromRoot": "examples/02-backend", - "slug": "backend" - }, - "readme": "This example shows how you can use HTML exported using the `blocksToFullHTML` and render it as a static document (a view-only document, without the editor). You can use this for example if you use BlockNote to edit blog posts in a CMS, but want to display non-editable static, published pages to end-users.\n\n**Relevant Docs:**\n\n- [Server-side processing](/docs/features/server-processing)" - } - ] + ], }, "ui-components": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components", - "projects": [ - { - "projectSlug": "formatting-toolbar-buttons", - "fullSlug": "ui-components/formatting-toolbar-buttons", - "pathFromRoot": "examples/03-ui-components/02-formatting-toolbar-buttons", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", + projects: [ + { + projectSlug: "formatting-toolbar-buttons", + fullSlug: "ui-components/formatting-toolbar-buttons", + pathFromRoot: "examples/03-ui-components/02-formatting-toolbar-buttons", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Inline Content", "UI Components", - "Formatting Toolbar" - ] + "Formatting Toolbar", + ], }, - "title": "Adding Formatting Toolbar Buttons", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Adding Formatting Toolbar Buttons", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we add a blue text/background color and code style button to the Formatting Toolbar.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click one of the new buttons!\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + "In this example, we add a blue text/background color and code style button to the Formatting Toolbar.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click one of the new buttons!\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "formatting-toolbar-block-type-items", - "fullSlug": "ui-components/formatting-toolbar-block-type-items", - "pathFromRoot": "examples/03-ui-components/03-formatting-toolbar-block-type-items", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + projectSlug: "formatting-toolbar-block-type-items", + fullSlug: "ui-components/formatting-toolbar-block-type-items", + pathFromRoot: + "examples/03-ui-components/03-formatting-toolbar-block-type-items", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Blocks", "UI Components", "Formatting Toolbar", - "Custom Schemas" + "Custom Schemas", ], - "dependencies": { + dependencies: { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1" - } as any + "react-icons": "^5.2.1", + } as any, }, - "title": "Adding Block Type Select Items", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Adding Block Type Select Items", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we add an item to the Block Type Select, so that it works for a custom alert block we create.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click \"Alert\" in the Block Type Select to change the selected block!\n\n**Relevant Docs:**\n\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Block Types](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we add an item to the Block Type Select, so that it works for a custom alert block we create.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click "Alert" in the Block Type Select to change the selected block!\n\n**Relevant Docs:**\n\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Block Types](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "side-menu-buttons", - "fullSlug": "ui-components/side-menu-buttons", - "pathFromRoot": "examples/03-ui-components/04-side-menu-buttons", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Intermediate", - "Blocks", - "UI Components", - "Block Side Menu" - ], - "dependencies": { - "react-icons": "^5.2.1" - } as any - }, - "title": "Adding Block Side Menu Buttons", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "In this example, we replace the button to add a block in the Block Side Menu, with a button to remove the hovered block.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click the new button!\n\n**Relevant Docs:**\n\n- [Changing the Block Side Menu](/docs/react/components/side-menu)\n- [Removing Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "side-menu-drag-handle-items", - "fullSlug": "ui-components/side-menu-drag-handle-items", - "pathFromRoot": "examples/03-ui-components/05-side-menu-drag-handle-items", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Intermediate", - "Blocks", - "UI Components", - "Block Side Menu" - ], - "dependencies": { - "react-icons": "^5.2.1" - } as any - }, - "title": "Adding Drag Handle Menu Items", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "In this example, we add an item to the Drag Handle Menu, which resets the hovered block to a paragraph.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click \"Reset Type\" in the Drag Handle Menu to reset the selected block!\n\n**Relevant Docs:**\n\n- [Changing Drag Handle Menu Items](/docs/react/components/side-menu)\n- [Updating Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "suggestion-menus-slash-menu-items", - "fullSlug": "ui-components/suggestion-menus-slash-menu-items", - "pathFromRoot": "examples/03-ui-components/06-suggestion-menus-slash-menu-items", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + projectSlug: "side-menu-buttons", + fullSlug: "ui-components/side-menu-buttons", + pathFromRoot: "examples/03-ui-components/04-side-menu-buttons", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Intermediate", "Blocks", "UI Components", "Block Side Menu"], + dependencies: { + "react-icons": "^5.2.1", + } as any, + }, + title: "Adding Block Side Menu Buttons", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", + }, + readme: + "In this example, we replace the button to add a block in the Block Side Menu, with a button to remove the hovered block.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click the new button!\n\n**Relevant Docs:**\n\n- [Changing the Block Side Menu](/docs/react/components/side-menu)\n- [Removing Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "side-menu-drag-handle-items", + fullSlug: "ui-components/side-menu-drag-handle-items", + pathFromRoot: + "examples/03-ui-components/05-side-menu-drag-handle-items", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Intermediate", "Blocks", "UI Components", "Block Side Menu"], + dependencies: { + "react-icons": "^5.2.1", + } as any, + }, + title: "Adding Drag Handle Menu Items", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", + }, + readme: + 'In this example, we add an item to the Drag Handle Menu, which resets the hovered block to a paragraph.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click "Reset Type" in the Drag Handle Menu to reset the selected block!\n\n**Relevant Docs:**\n\n- [Changing Drag Handle Menu Items](/docs/react/components/side-menu)\n- [Updating Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)', + }, + { + projectSlug: "suggestion-menus-slash-menu-items", + fullSlug: "ui-components/suggestion-menus-slash-menu-items", + pathFromRoot: + "examples/03-ui-components/06-suggestion-menus-slash-menu-items", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "Blocks", "UI Components", "Suggestion Menus", - "Slash Menu" + "Slash Menu", ], - "dependencies": { - "react-icons": "^5.2.1" - } as any - }, - "title": "Adding Slash Menu Items", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "In this example, we add an item to the Slash Menu, which adds a new block below with a bold \"Hello World\" string.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and select the new item!\n\n**Relevant Docs:**\n\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Getting Text Cursor Position](/docs/reference/editor/cursor-selections)\n- [Inserting New Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "suggestion-menus-slash-menu-component", - "fullSlug": "ui-components/suggestion-menus-slash-menu-component", - "pathFromRoot": "examples/03-ui-components/07-suggestion-menus-slash-menu-component", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + dependencies: { + "react-icons": "^5.2.1", + } as any, + }, + title: "Adding Slash Menu Items", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", + }, + readme: + 'In this example, we add an item to the Slash Menu, which adds a new block below with a bold "Hello World" string.\n\n**Try it out:** Press the "/" key to open the Slash Menu and select the new item!\n\n**Relevant Docs:**\n\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Getting Text Cursor Position](/docs/reference/editor/cursor-selections)\n- [Inserting New Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)', + }, + { + projectSlug: "suggestion-menus-slash-menu-component", + fullSlug: "ui-components/suggestion-menus-slash-menu-component", + pathFromRoot: + "examples/03-ui-components/07-suggestion-menus-slash-menu-component", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "UI Components", "Suggestion Menus", "Slash Menu", - "Appearance & Styling" - ] + "Appearance & Styling", + ], }, - "title": "Replacing Slash Menu Component", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Replacing Slash Menu Component", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we replace the default Slash Menu component with a basic custom one.\n\n**Try it out:** Press the \"/\" key to see the new Slash Menu!\n\n**Relevant Docs:**\n\n- [Replacing the Slash Menu Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we replace the default Slash Menu component with a basic custom one.\n\n**Try it out:** Press the "/" key to see the new Slash Menu!\n\n**Relevant Docs:**\n\n- [Replacing the Slash Menu Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "suggestion-menus-emoji-picker-columns", - "fullSlug": "ui-components/suggestion-menus-emoji-picker-columns", - "pathFromRoot": "examples/03-ui-components/08-suggestion-menus-emoji-picker-columns", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + projectSlug: "suggestion-menus-emoji-picker-columns", + fullSlug: "ui-components/suggestion-menus-emoji-picker-columns", + pathFromRoot: + "examples/03-ui-components/08-suggestion-menus-emoji-picker-columns", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "Blocks", "UI Components", "Suggestion Menus", - "Emoji Picker" - ] + "Emoji Picker", + ], }, - "title": "Changing Emoji Picker Columns", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Changing Emoji Picker Columns", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we change the Emoji Picker to display 5 columns instead of 10.\n\n**Try it out:** Press the \":\" key to open the Emoji Picker!\n\n**Relevant Docs:**\n\n- [Changing Emoji Picker Columns](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we change the Emoji Picker to display 5 columns instead of 10.\n\n**Try it out:** Press the ":" key to open the Emoji Picker!\n\n**Relevant Docs:**\n\n- [Changing Emoji Picker Columns](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "suggestion-menus-emoji-picker-component", - "fullSlug": "ui-components/suggestion-menus-emoji-picker-component", - "pathFromRoot": "examples/03-ui-components/09-suggestion-menus-emoji-picker-component", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + projectSlug: "suggestion-menus-emoji-picker-component", + fullSlug: "ui-components/suggestion-menus-emoji-picker-component", + pathFromRoot: + "examples/03-ui-components/09-suggestion-menus-emoji-picker-component", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "UI Components", "Suggestion Menus", "Emoji Picker", - "Appearance & Styling" - ] + "Appearance & Styling", + ], }, - "title": "Replacing Emoji Picker Component", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Replacing Emoji Picker Component", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we replace the default Emoji Picker component with a basic custom one.\n\n**Try it out:** Press the \":\" key to see the new Emoji Picker!\n\n**Relevant Docs:**\n\n- [Replacing the Emoji Picker Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we replace the default Emoji Picker component with a basic custom one.\n\n**Try it out:** Press the ":" key to see the new Emoji Picker!\n\n**Relevant Docs:**\n\n- [Replacing the Emoji Picker Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "suggestion-menus-grid-mentions", - "fullSlug": "ui-components/suggestion-menus-grid-mentions", - "pathFromRoot": "examples/03-ui-components/10-suggestion-menus-grid-mentions", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + projectSlug: "suggestion-menus-grid-mentions", + fullSlug: "ui-components/suggestion-menus-grid-mentions", + pathFromRoot: + "examples/03-ui-components/10-suggestion-menus-grid-mentions", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "Inline Content", "Custom Schemas", - "Suggestion Menus" - ] + "Suggestion Menus", + ], }, - "title": "Grid Mentions Menu", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Grid Mentions Menu", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the \"@\" character. This Suggestion Menu is displayed as a grid of 2 columns, where each item is the first letter of the person's name.\n\n**Try it out:** Press the \"@\" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the "@" character. This Suggestion Menu is displayed as a grid of 2 columns, where each item is the first letter of the person\'s name.\n\n**Try it out:** Press the "@" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "uppy-file-panel", - "fullSlug": "ui-components/uppy-file-panel", - "pathFromRoot": "examples/03-ui-components/11-uppy-file-panel", - "config": { - "playground": true, - "docs": true, - "author": "ezhil56x", - "tags": [ - "Intermediate", - "Files" - ], - "dependencies": { + projectSlug: "uppy-file-panel", + fullSlug: "ui-components/uppy-file-panel", + pathFromRoot: "examples/03-ui-components/11-uppy-file-panel", + config: { + playground: true, + docs: true, + author: "ezhil56x", + tags: ["Intermediate", "Files"], + dependencies: { "@uppy/core": "^3.13.1", "@uppy/dashboard": "^3.9.1", "@uppy/drag-drop": "^3.1.1", @@ -619,48 +592,50 @@ "@uppy/status-bar": "^3.1.1", "@uppy/webcam": "^3.4.2", "@uppy/xhr-upload": "^3.4.0", - "react-icons": "^5.2.1" + "react-icons": "^5.2.1", } as any, - "pro": true + pro: true, }, - "title": "Uppy File Panel", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Uppy File Panel", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "This example allows users to upload files using [Uppy](https://uppy.io/) by replacing the default File Panel with an Uppy Dashboard.\n\nUppy is highly extensible and has an extensive ecosystem of plugins. For example, you can:\n\n- Record audio, screen or webcam\n- Import files from Box / Dropbox / Facebook / Google Drive / Google Photos / Instagram / OneDrive / Zoom\n- Select files from Unsplash\n- Show an image editor (crop, rotate, etc)\n\nIn this example, we've enabled the Webcam, ScreenCapture and Image Editor plugins.\n\n**Try it out:** Click the \"Add Image\" button and you can either drop files or click \"browse files\" to upload them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Image](/docs/foundations/schemas)" + readme: + 'This example allows users to upload files using [Uppy](https://uppy.io/) by replacing the default File Panel with an Uppy Dashboard.\n\nUppy is highly extensible and has an extensive ecosystem of plugins. For example, you can:\n\n- Record audio, screen or webcam\n- Import files from Box / Dropbox / Facebook / Google Drive / Google Photos / Instagram / OneDrive / Zoom\n- Select files from Unsplash\n- Show an image editor (crop, rotate, etc)\n\nIn this example, we\'ve enabled the Webcam, ScreenCapture and Image Editor plugins.\n\n**Try it out:** Click the "Add Image" button and you can either drop files or click "browse files" to upload them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Image](/docs/foundations/schemas)', }, { - "projectSlug": "static-formatting-toolbar", - "fullSlug": "ui-components/static-formatting-toolbar", - "pathFromRoot": "examples/03-ui-components/12-static-formatting-toolbar", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + projectSlug: "static-formatting-toolbar", + fullSlug: "ui-components/static-formatting-toolbar", + pathFromRoot: "examples/03-ui-components/12-static-formatting-toolbar", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Basic", "UI Components", "Formatting Toolbar", - "Appearance & Styling" - ] + "Appearance & Styling", + ], }, - "title": "Static Formatting Toolbar", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Static Formatting Toolbar", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "This example shows how to make the formatting toolbar always visible and static\nabove the editor.\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + "This example shows how to make the formatting toolbar always visible and static\nabove the editor.\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "custom-ui", - "fullSlug": "ui-components/custom-ui", - "pathFromRoot": "examples/03-ui-components/13-custom-ui", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + projectSlug: "custom-ui", + fullSlug: "ui-components/custom-ui", + pathFromRoot: "examples/03-ui-components/13-custom-ui", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Advanced", "Inline Content", "UI Components", @@ -668,1102 +643,1052 @@ "Formatting Toolbar", "Suggestion Menus", "Slash Menu", - "Appearance & Styling" + "Appearance & Styling", ], - "dependencies": { + dependencies: { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@mui/icons-material": "^5.16.1", - "@mui/material": "^5.16.1" + "@mui/material": "^5.16.1", } as any, - "pro": true - }, - "title": "UI With Third-Party Components", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "In this example, we implement a basic editor interface using components from Material UI. We replace the Formatting Toolbar, Slash Menu, and Block Side Menu while disabling the other default elements. Additionally, the Formatting Toolbar is made static and always visible above the editor.\n\n**Relevant Docs:**\n\n- [Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Slash Menu](/docs/react/components/suggestion-menus)\n- [Side Menu](/docs/react/components/side-menu)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "experimental-mobile-formatting-toolbar", - "fullSlug": "ui-components/experimental-mobile-formatting-toolbar", - "pathFromRoot": "examples/03-ui-components/14-experimental-mobile-formatting-toolbar", - "config": { - "playground": true, - "docs": true, - "author": "areknawo", - "tags": [ + pro: true, + }, + title: "UI With Third-Party Components", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", + }, + readme: + "In this example, we implement a basic editor interface using components from Material UI. We replace the Formatting Toolbar, Slash Menu, and Block Side Menu while disabling the other default elements. Additionally, the Formatting Toolbar is made static and always visible above the editor.\n\n**Relevant Docs:**\n\n- [Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Slash Menu](/docs/react/components/suggestion-menus)\n- [Side Menu](/docs/react/components/side-menu)\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "experimental-mobile-formatting-toolbar", + fullSlug: "ui-components/experimental-mobile-formatting-toolbar", + pathFromRoot: + "examples/03-ui-components/14-experimental-mobile-formatting-toolbar", + config: { + playground: true, + docs: true, + author: "areknawo", + tags: [ "Intermediate", "UI Components", "Formatting Toolbar", - "Appearance & Styling" - ] + "Appearance & Styling", + ], }, - "title": "Experimental Mobile Formatting Toolbar", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" + title: "Experimental Mobile Formatting Toolbar", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "This example shows how to use the experimental mobile formatting toolbar, which uses [Visual Viewport API](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API) to position the toolbar right above the virtual keyboard on mobile devices.\n\nController is currently marked **experimental** due to the flickering issue with positioning (caused by delays of the Visual Viewport API)\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + "This example shows how to use the experimental mobile formatting toolbar, which uses [Visual Viewport API](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API) to position the toolbar right above the virtual keyboard on mobile devices.\n\nController is currently marked **experimental** due to the flickering issue with positioning (caused by delays of the Visual Viewport API)\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "advanced-tables", - "fullSlug": "ui-components/advanced-tables", - "pathFromRoot": "examples/03-ui-components/15-advanced-tables", - "config": { - "playground": true, - "docs": true, - "author": "nperez0111", - "tags": [ + projectSlug: "advanced-tables", + fullSlug: "ui-components/advanced-tables", + pathFromRoot: "examples/03-ui-components/15-advanced-tables", + config: { + playground: true, + docs: true, + author: "nperez0111", + tags: [ "Intermediate", "UI Components", "Tables", - "Appearance & Styling" - ] - }, - "title": "Advanced Tables", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "This example enables the following features in tables:\n\n- Split cells\n- Cell background color\n- Cell text color\n- Table row and column headers\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "link-toolbar-buttons", - "fullSlug": "ui-components/link-toolbar-buttons", - "pathFromRoot": "examples/03-ui-components/link-toolbar-buttons", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Adding Link Toolbar Buttons", - "group": { - "pathFromRoot": "examples/03-ui-components", - "slug": "ui-components" - }, - "readme": "In this example, we add a button to the Link Toolbar which opens a browser alert.\n\n**Try it out:** Hover the link open the Link Toolbar, and click the new \"Open Alert\" button!\n\n**Relevant Docs:**\n\n- [Changing the Link Toolbar](/docs/react/components/link-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" - } - ] - }, - "theming": { - "pathFromRoot": "examples/04-theming", - "slug": "theming", - "projects": [ - { - "projectSlug": "theming-dom-attributes", - "fullSlug": "theming/theming-dom-attributes", - "pathFromRoot": "examples/04-theming/01-theming-dom-attributes", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Blocks", - "Appearance & Styling" - ] - }, - "title": "Adding CSS Class to Blocks", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" - }, - "readme": "In this example, we add a `hello-world-block` class to each block in the editor. We also create a CSS rule to add a border to all elements with that class.\n\n**Relevant Docs:**\n\n- [Adding DOM Attributes](/docs/react/styling-theming/adding-dom-attributes)" - }, - { - "projectSlug": "changing-font", - "fullSlug": "theming/changing-font", - "pathFromRoot": "examples/04-theming/02-changing-font", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Appearance & Styling" - ] + "Appearance & Styling", + ], }, - "title": "Changing Editor Font", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" + title: "Advanced Tables", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we override some of the default editor CSS to change font within the editor.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)" + readme: + "This example enables the following features in tables:\n\n- Split cells\n- Cell background color\n- Cell text color\n- Table row and column headers\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "theming-css", - "fullSlug": "theming/theming-css", - "pathFromRoot": "examples/04-theming/03-theming-css", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Appearance & Styling", - "UI Components" - ] + projectSlug: "link-toolbar-buttons", + fullSlug: "ui-components/link-toolbar-buttons", + pathFromRoot: "examples/03-ui-components/link-toolbar-buttons", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], }, - "title": "Overriding CSS Styles", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" + title: "Adding Link Toolbar Buttons", + group: { + pathFromRoot: "examples/03-ui-components", + slug: "ui-components", }, - "readme": "In this example, we override some of the default editor CSS to make the editor text and hovered Slash Menu items blue.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)" + readme: + 'In this example, we add a button to the Link Toolbar which opens a browser alert.\n\n**Try it out:** Hover the link open the Link Toolbar, and click the new "Open Alert" button!\n\n**Relevant Docs:**\n\n- [Changing the Link Toolbar](/docs/react/components/link-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, - { - "projectSlug": "theming-css-variables", - "fullSlug": "theming/theming-css-variables", - "pathFromRoot": "examples/04-theming/04-theming-css-variables", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Appearance & Styling", - "UI Components" - ] + ], + }, + theming: { + pathFromRoot: "examples/04-theming", + slug: "theming", + projects: [ + { + projectSlug: "theming-dom-attributes", + fullSlug: "theming/theming-dom-attributes", + pathFromRoot: "examples/04-theming/01-theming-dom-attributes", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Blocks", "Appearance & Styling"], + }, + title: "Adding CSS Class to Blocks", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", + }, + readme: + "In this example, we add a `hello-world-block` class to each block in the editor. We also create a CSS rule to add a border to all elements with that class.\n\n**Relevant Docs:**\n\n- [Adding DOM Attributes](/docs/react/styling-theming/adding-dom-attributes)", + }, + { + projectSlug: "changing-font", + fullSlug: "theming/changing-font", + pathFromRoot: "examples/04-theming/02-changing-font", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Appearance & Styling"], + }, + title: "Changing Editor Font", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", + }, + readme: + "In this example, we override some of the default editor CSS to change font within the editor.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)", + }, + { + projectSlug: "theming-css", + fullSlug: "theming/theming-css", + pathFromRoot: "examples/04-theming/03-theming-css", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Appearance & Styling", "UI Components"], + }, + title: "Overriding CSS Styles", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", + }, + readme: + "In this example, we override some of the default editor CSS to make the editor text and hovered Slash Menu items blue.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)", + }, + { + projectSlug: "theming-css-variables", + fullSlug: "theming/theming-css-variables", + pathFromRoot: "examples/04-theming/04-theming-css-variables", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Appearance & Styling", "UI Components"], + }, + title: "Overriding Theme CSS Variables", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", + }, + readme: + "In this example, we override the editor's default theme CSS variables to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Theme CSS Variables](/docs/react/styling-theming/themes#css-variables)", + }, + { + projectSlug: "theming-css-variables-code", + fullSlug: "theming/theming-css-variables-code", + pathFromRoot: "examples/04-theming/05-theming-css-variables-code", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Appearance & Styling", "UI Components"], + }, + title: "Changing Themes Through Code", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", + }, + readme: + "In this example, we use the `BlockNoteView` component's `theme` props to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Changing CSS Variables Through Code](/docs/react/styling-theming/themes#programmatic-configuration)", + }, + { + projectSlug: "code-block", + fullSlug: "theming/code-block", + pathFromRoot: "examples/04-theming/06-code-block", + config: { + playground: true, + docs: true, + author: "nperez0111", + tags: ["Basic"], + dependencies: { + "@blocknote/code-block": "latest", + } as any, }, - "title": "Overriding Theme CSS Variables", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" + title: "Code Block Syntax Highlighting", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", }, - "readme": "In this example, we override the editor's default theme CSS variables to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Theme CSS Variables](/docs/react/styling-theming/themes#css-variables)" + readme: + "To enable code block syntax highlighting, you can use the `codeBlock` option in the `useCreateBlockNote` hook. This is excluded by default to reduce bundle size.\n\n**Relevant Docs:**\n\n- [Code Block Syntax Highlighting](/docs/features/blocks/code-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "theming-css-variables-code", - "fullSlug": "theming/theming-css-variables-code", - "pathFromRoot": "examples/04-theming/05-theming-css-variables-code", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Appearance & Styling", - "UI Components" - ] - }, - "title": "Changing Themes Through Code", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" - }, - "readme": "In this example, we use the `BlockNoteView` component's `theme` props to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Changing CSS Variables Through Code](/docs/react/styling-theming/themes#programmatic-configuration)" - }, - { - "projectSlug": "code-block", - "fullSlug": "theming/code-block", - "pathFromRoot": "examples/04-theming/06-code-block", - "config": { - "playground": true, - "docs": true, - "author": "nperez0111", - "tags": [ - "Basic" - ], - "dependencies": { - "@blocknote/code-block": "latest" - } as any - }, - "title": "Code Block Syntax Highlighting", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" - }, - "readme": "To enable code block syntax highlighting, you can use the `codeBlock` option in the `useCreateBlockNote` hook. This is excluded by default to reduce bundle size.\n\n**Relevant Docs:**\n\n- [Code Block Syntax Highlighting](/docs/features/blocks/code-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "custom-code-block", - "fullSlug": "theming/custom-code-block", - "pathFromRoot": "examples/04-theming/07-custom-code-block", - "config": { - "playground": true, - "docs": true, - "author": "nperez0111", - "tags": [ - "Basic" - ], - "dependencies": { + projectSlug: "custom-code-block", + fullSlug: "theming/custom-code-block", + pathFromRoot: "examples/04-theming/07-custom-code-block", + config: { + playground: true, + docs: true, + author: "nperez0111", + tags: ["Basic"], + dependencies: { "@blocknote/code-block": "latest", "@shikijs/types": "^3.2.1", "@shikijs/core": "^3.2.1", "@shikijs/engine-javascript": "^3.2.1", "@shikijs/langs-precompiled": "^3.2.1", - "@shikijs/themes": "^3.2.1" - } as any - }, - "title": "Custom Code Block Theme & Language", - "group": { - "pathFromRoot": "examples/04-theming", - "slug": "theming" - }, - "readme": "To configure a code block highlighting theme and language, you can use the `codeBlock` option in the `useCreateBlockNote` hook.\n\nThis allows you to configure a shiki highlighter for the code blocks of your editor, allowing you to tailor the themes and languages you would like to use.\n\nTo create a syntax highlighter, you can use the [shiki-codegen](https://shiki.style/packages/codegen) CLI for generating the code to create a syntax highlighter for your languages and themes.\n\nFor example to create a syntax highlighter using the optimized javascript engine, javascript, typescript, vue, with light and dark themes, you can run the following command:\n\n```bash\nnpx shiki-codegen --langs javascript,typescript,vue --themes light,dark --engine javascript --precompiled ./shiki.bundle.ts\n```\n\nThis will generate a `shiki.bundle.ts` file that you can use to create a syntax highlighter for your editor.\n\nLike this:\n\n```ts\nimport { createHighlighter } from \"./shiki.bundle\";\n\nexport default function App() {\n // Creates a new editor instance.\n const editor = useCreateBlockNote({\n codeBlock: {\n indentLineWithTab: true,\n defaultLanguage: \"typescript\",\n supportedLanguages: {\n typescript: {\n name: \"TypeScript\",\n aliases: [\"ts\"],\n },\n },\n createHighlighter: () =>\n createHighlighter({\n themes: [\"light-plus\", \"dark-plus\"],\n langs: [],\n }),\n },\n });\n\n return ;\n}\n```\n\n**Relevant Docs:**\n\n- [Code Blocks](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)" - } - ] - }, - "interoperability": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability", - "projects": [ - { - "projectSlug": "converting-blocks-to-html", - "fullSlug": "interoperability/converting-blocks-to-html", - "pathFromRoot": "examples/05-interoperability/01-converting-blocks-to-html", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Blocks", - "Import/Export" - ] - }, - "title": "Converting Blocks to HTML", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example exports the current document (all blocks) as HTML and displays it below the editor.\n\n**Try it out:** Edit the document to see the HTML representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to HTML](/docs/features/export/html)" - }, - { - "projectSlug": "converting-blocks-from-html", - "fullSlug": "interoperability/converting-blocks-from-html", - "pathFromRoot": "examples/05-interoperability/02-converting-blocks-from-html", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic", - "Blocks", - "Import/Export" - ] - }, - "title": "Parsing HTML to Blocks", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the HTML in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing HTML to Blocks](/docs/features/import/html)" - }, - { - "projectSlug": "converting-blocks-to-md", - "fullSlug": "interoperability/converting-blocks-to-md", - "pathFromRoot": "examples/05-interoperability/03-converting-blocks-to-md", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic", - "Blocks", - "Import/Export" - ] + "@shikijs/themes": "^3.2.1", + } as any, }, - "title": "Converting Blocks to Markdown", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" + title: "Custom Code Block Theme & Language", + group: { + pathFromRoot: "examples/04-theming", + slug: "theming", }, - "readme": "This example exports the current document (all blocks) as Markdown and displays it below the editor.\n\n**Try it out:** Edit the document to see the Markdown representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to Markdown](/docs/features/export/markdown)" + readme: + 'To configure a code block highlighting theme and language, you can use the `codeBlock` option in the `useCreateBlockNote` hook.\n\nThis allows you to configure a shiki highlighter for the code blocks of your editor, allowing you to tailor the themes and languages you would like to use.\n\nTo create a syntax highlighter, you can use the [shiki-codegen](https://shiki.style/packages/codegen) CLI for generating the code to create a syntax highlighter for your languages and themes.\n\nFor example to create a syntax highlighter using the optimized javascript engine, javascript, typescript, vue, with light and dark themes, you can run the following command:\n\n```bash\nnpx shiki-codegen --langs javascript,typescript,vue --themes light,dark --engine javascript --precompiled ./shiki.bundle.ts\n```\n\nThis will generate a `shiki.bundle.ts` file that you can use to create a syntax highlighter for your editor.\n\nLike this:\n\n```ts\nimport { createHighlighter } from "./shiki.bundle";\n\nexport default function App() {\n // Creates a new editor instance.\n const editor = useCreateBlockNote({\n codeBlock: {\n indentLineWithTab: true,\n defaultLanguage: "typescript",\n supportedLanguages: {\n typescript: {\n name: "TypeScript",\n aliases: ["ts"],\n },\n },\n createHighlighter: () =>\n createHighlighter({\n themes: ["light-plus", "dark-plus"],\n langs: [],\n }),\n },\n });\n\n return ;\n}\n```\n\n**Relevant Docs:**\n\n- [Code Blocks](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)', }, - { - "projectSlug": "converting-blocks-from-md", - "fullSlug": "interoperability/converting-blocks-from-md", - "pathFromRoot": "examples/05-interoperability/04-converting-blocks-from-md", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Basic", - "Blocks", - "Import/Export" - ] - }, - "title": "Parsing Markdown to Blocks", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the Markdown in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing Markdown to Blocks](/docs/features/import/markdown)" - }, - { - "projectSlug": "converting-blocks-to-pdf", - "fullSlug": "interoperability/converting-blocks-to-pdf", - "pathFromRoot": "examples/05-interoperability/05-converting-blocks-to-pdf", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Interoperability" - ], - "dependencies": { + ], + }, + interoperability: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + projects: [ + { + projectSlug: "converting-blocks-to-html", + fullSlug: "interoperability/converting-blocks-to-html", + pathFromRoot: + "examples/05-interoperability/01-converting-blocks-to-html", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Blocks", "Import/Export"], + }, + title: "Converting Blocks to HTML", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + "This example exports the current document (all blocks) as HTML and displays it below the editor.\n\n**Try it out:** Edit the document to see the HTML representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to HTML](/docs/features/export/html)", + }, + { + projectSlug: "converting-blocks-from-html", + fullSlug: "interoperability/converting-blocks-from-html", + pathFromRoot: + "examples/05-interoperability/02-converting-blocks-from-html", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic", "Blocks", "Import/Export"], + }, + title: "Parsing HTML to Blocks", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the HTML in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing HTML to Blocks](/docs/features/import/html)", + }, + { + projectSlug: "converting-blocks-to-md", + fullSlug: "interoperability/converting-blocks-to-md", + pathFromRoot: "examples/05-interoperability/03-converting-blocks-to-md", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic", "Blocks", "Import/Export"], + }, + title: "Converting Blocks to Markdown", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + "This example exports the current document (all blocks) as Markdown and displays it below the editor.\n\n**Try it out:** Edit the document to see the Markdown representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to Markdown](/docs/features/export/markdown)", + }, + { + projectSlug: "converting-blocks-from-md", + fullSlug: "interoperability/converting-blocks-from-md", + pathFromRoot: + "examples/05-interoperability/04-converting-blocks-from-md", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Basic", "Blocks", "Import/Export"], + }, + title: "Parsing Markdown to Blocks", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the Markdown in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing Markdown to Blocks](/docs/features/import/markdown)", + }, + { + projectSlug: "converting-blocks-to-pdf", + fullSlug: "interoperability/converting-blocks-to-pdf", + pathFromRoot: + "examples/05-interoperability/05-converting-blocks-to-pdf", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Interoperability"], + dependencies: { "@blocknote/xl-pdf-exporter": "latest", "@blocknote/xl-multi-column": "latest", - "@react-pdf/renderer": "^4.3.0" + "@react-pdf/renderer": "^4.3.0", } as any, - "pro": true - }, - "title": "Exporting documents to PDF", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example exports the current document (all blocks) as an PDF file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .pdf\" in top-left corner, to download the PDF file." - }, - { - "projectSlug": "converting-blocks-to-docx", - "fullSlug": "interoperability/converting-blocks-to-docx", - "pathFromRoot": "examples/05-interoperability/06-converting-blocks-to-docx", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "" - ], - "dependencies": { + pro: true, + }, + title: "Exporting documents to PDF", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + 'This example exports the current document (all blocks) as an PDF file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .pdf" in top-left corner, to download the PDF file.', + }, + { + projectSlug: "converting-blocks-to-docx", + fullSlug: "interoperability/converting-blocks-to-docx", + pathFromRoot: + "examples/05-interoperability/06-converting-blocks-to-docx", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [""], + dependencies: { "@blocknote/xl-docx-exporter": "latest", "@blocknote/xl-multi-column": "latest", - "docx": "^9.0.2" + docx: "^9.0.2", } as any, - "pro": true - }, - "title": "Exporting documents to .docx (Office Open XML)", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example exports the current document (all blocks) as an Microsoft Word Document (DOCX) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .docx\" in top-left corner, to download the DOCX file." - }, - { - "projectSlug": "converting-blocks-to-odt", - "fullSlug": "interoperability/converting-blocks-to-odt", - "pathFromRoot": "examples/05-interoperability/07-converting-blocks-to-odt", - "config": { - "playground": true, - "docs": true, - "author": "areknawo", - "tags": [ - "" - ], - "dependencies": { + pro: true, + }, + title: "Exporting documents to .docx (Office Open XML)", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + 'This example exports the current document (all blocks) as an Microsoft Word Document (DOCX) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .docx" in top-left corner, to download the DOCX file.', + }, + { + projectSlug: "converting-blocks-to-odt", + fullSlug: "interoperability/converting-blocks-to-odt", + pathFromRoot: + "examples/05-interoperability/07-converting-blocks-to-odt", + config: { + playground: true, + docs: true, + author: "areknawo", + tags: [""], + dependencies: { "@blocknote/xl-odt-exporter": "latest", - "@blocknote/xl-multi-column": "latest" + "@blocknote/xl-multi-column": "latest", } as any, - "pro": true - }, - "title": "Exporting documents to .odt (Open Document Text)", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" - }, - "readme": "This example exports the current document (all blocks) as an Open Document Text (ODT) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .odt\" in top-left corner, to download the ODT file." - }, - { - "projectSlug": "converting-blocks-to-react-email", - "fullSlug": "interoperability/converting-blocks-to-react-email", - "pathFromRoot": "examples/05-interoperability/08-converting-blocks-to-react-email", - "config": { - "playground": true, - "docs": true, - "author": "jmarbutt", - "tags": [ - "" - ], - "dependencies": { + pro: true, + }, + title: "Exporting documents to .odt (Open Document Text)", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", + }, + readme: + 'This example exports the current document (all blocks) as an Open Document Text (ODT) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .odt" in top-left corner, to download the ODT file.', + }, + { + projectSlug: "converting-blocks-to-react-email", + fullSlug: "interoperability/converting-blocks-to-react-email", + pathFromRoot: + "examples/05-interoperability/08-converting-blocks-to-react-email", + config: { + playground: true, + docs: true, + author: "jmarbutt", + tags: [""], + dependencies: { "@blocknote/xl-email-exporter": "latest", - "@react-email/render": "^1.1.2" + "@react-email/render": "^1.1.2", } as any, - "pro": true + pro: true, }, - "title": "Exporting documents to React Email", - "group": { - "pathFromRoot": "examples/05-interoperability", - "slug": "interoperability" + title: "Exporting documents to React Email", + group: { + pathFromRoot: "examples/05-interoperability", + slug: "interoperability", }, - "readme": "This example exports the current document (all blocks) as a React Email document.\n\n**Try it out:** Edit the document and the preview will update." - } - ] + readme: + "This example exports the current document (all blocks) as a React Email document.\n\n**Try it out:** Edit the document and the preview will update.", + }, + ], }, "custom-schema": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema", - "projects": [ - { - "projectSlug": "alert-block", - "fullSlug": "custom-schema/alert-block", - "pathFromRoot": "examples/06-custom-schema/01-alert-block", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + projects: [ + { + projectSlug: "alert-block", + fullSlug: "custom-schema/alert-block", + pathFromRoot: "examples/06-custom-schema/01-alert-block", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Blocks", "Custom Schemas", "Suggestion Menus", - "Slash Menu" + "Slash Menu", ], - "dependencies": { + dependencies: { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1" - } as any + "react-icons": "^5.2.1", + } as any, }, - "title": "Alert Block", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" + title: "Alert Block", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", }, - "readme": "In this example, we create a custom `Alert` block which is used to emphasize text.\n\n**Try it out:** Click the \"!\" icon to change the alert type!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we create a custom `Alert` block which is used to emphasize text.\n\n**Try it out:** Click the "!" icon to change the alert type!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "suggestion-menus-mentions", - "fullSlug": "custom-schema/suggestion-menus-mentions", - "pathFromRoot": "examples/06-custom-schema/02-suggestion-menus-mentions", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ + projectSlug: "suggestion-menus-mentions", + fullSlug: "custom-schema/suggestion-menus-mentions", + pathFromRoot: "examples/06-custom-schema/02-suggestion-menus-mentions", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: [ "Intermediate", "Inline Content", "Custom Schemas", - "Suggestion Menus" - ] + "Suggestion Menus", + ], }, - "title": "Mentions Menu", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" + title: "Mentions Menu", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", }, - "readme": "In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the \"@\" character.\n\n**Try it out:** Press the \"@\" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus#creating-additional-suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the "@" character.\n\n**Try it out:** Press the "@" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus#creating-additional-suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "font-style", - "fullSlug": "custom-schema/font-style", - "pathFromRoot": "examples/06-custom-schema/03-font-style", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + projectSlug: "font-style", + fullSlug: "custom-schema/font-style", + pathFromRoot: "examples/06-custom-schema/03-font-style", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Inline Content", "Custom Schemas", - "Formatting Toolbar" + "Formatting Toolbar", ], - "dependencies": { - "react-icons": "^5.2.1" - } as any - }, - "title": "Font Style", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "In this example, we create a custom `Font` style which is used to set the `fontFamily` style. In addition, we create a Formatting Toolbar button which sets the `Font` style on the selected text.\n\n**Try it out:** Highlight some text to open the Formatting Toolbar and set the `Font` style!\n\n**Relevant Docs:**\n\n- [Custom Styles](/docs/features/custom-schemas/custom-styles)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "pdf-file-block", - "fullSlug": "custom-schema/pdf-file-block", - "pathFromRoot": "examples/06-custom-schema/04-pdf-file-block", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + dependencies: { + "react-icons": "^5.2.1", + } as any, + }, + title: "Font Style", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: + "In this example, we create a custom `Font` style which is used to set the `fontFamily` style. In addition, we create a Formatting Toolbar button which sets the `Font` style on the selected text.\n\n**Try it out:** Highlight some text to open the Formatting Toolbar and set the `Font` style!\n\n**Relevant Docs:**\n\n- [Custom Styles](/docs/features/custom-schemas/custom-styles)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + { + projectSlug: "pdf-file-block", + fullSlug: "custom-schema/pdf-file-block", + pathFromRoot: "examples/06-custom-schema/04-pdf-file-block", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Blocks", "Custom Schemas", "Suggestion Menus", - "Slash Menu" + "Slash Menu", ], - "dependencies": { + dependencies: { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1" + "react-icons": "^5.2.1", } as any, - "pro": true + pro: true, }, - "title": "PDF Block", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" + title: "PDF Block", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", }, - "readme": "In this example, we create a custom `PDF` block which extends the built-in `File` block. In addition, we create a Slash Menu item which inserts a `PDF` block.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and insert an `PDF` block!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, we create a custom `PDF` block which extends the built-in `File` block. In addition, we create a Slash Menu item which inserts a `PDF` block.\n\n**Try it out:** Press the "/" key to open the Slash Menu and insert an `PDF` block!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "alert-block-full-ux", - "fullSlug": "custom-schema/alert-block-full-ux", - "pathFromRoot": "examples/06-custom-schema/05-alert-block-full-ux", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ + projectSlug: "alert-block-full-ux", + fullSlug: "custom-schema/alert-block-full-ux", + pathFromRoot: "examples/06-custom-schema/05-alert-block-full-ux", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: [ "Intermediate", "Blocks", "Custom Schemas", "Formatting Toolbar", "Suggestion Menus", - "Slash Menu" + "Slash Menu", ], - "dependencies": { + dependencies: { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1" - } as any - }, - "title": "Alert Block with Full UX", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "In this example, we create a custom `Alert` block which is used to emphasize text, same as in the [minimal `Alert` block example](/examples/custom-schema/alert-block). However, in this example, we also add a command to insert the block via the Slash Menu, and an entry in the Formatting Toolbar's Block Type Select to change the current block to an `Alert`.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and insert an `Alert` block! Or highlight text in a paragraph, then change the block type to an `Alert` using the Block Type Select in the Formatting Toolbar!\n\n**Relevant Docs:**\n\n- [Minimal Alert Block Example](/examples/custom-schema/alert-block)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" - }, - { - "projectSlug": "toggleable-blocks", - "fullSlug": "custom-schema/toggleable-blocks", - "pathFromRoot": "examples/06-custom-schema/06-toggleable-blocks", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Basic" - ] - }, - "title": "Toggleable Custom Blocks", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "This example shows how to create custom blocks with a toggle button to show/hide their children, like with the default toggle heading and list item blocks. This is done using the use the `ToggleWrapper` component from `@blocknote/react`.\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Default Schema](/docs/features/blocks)" - }, - { - "projectSlug": "draggable-inline-content", - "fullSlug": "custom-schema/draggable-inline-content", - "pathFromRoot": "examples/06-custom-schema/draggable-inline-content", - "config": { - "playground": true, - "docs": false, - "author": "hectorzhuang", - "tags": [] - }, - "title": "Draggable Inline Content", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "" - }, - { - "projectSlug": "react-custom-blocks", - "fullSlug": "custom-schema/react-custom-blocks", - "pathFromRoot": "examples/06-custom-schema/react-custom-blocks", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Blocks - React API", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "" - }, - { - "projectSlug": "react-custom-inline-content", - "fullSlug": "custom-schema/react-custom-inline-content", - "pathFromRoot": "examples/06-custom-schema/react-custom-inline-content", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Inline Content - React API", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "" - }, - { - "projectSlug": "react-custom-styles", - "fullSlug": "custom-schema/react-custom-styles", - "pathFromRoot": "examples/06-custom-schema/react-custom-styles", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Styles - React API", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - }, - "readme": "" - } - ] + "react-icons": "^5.2.1", + } as any, + }, + title: "Alert Block with Full UX", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: + 'In this example, we create a custom `Alert` block which is used to emphasize text, same as in the [minimal `Alert` block example](/examples/custom-schema/alert-block). However, in this example, we also add a command to insert the block via the Slash Menu, and an entry in the Formatting Toolbar\'s Block Type Select to change the current block to an `Alert`.\n\n**Try it out:** Press the "/" key to open the Slash Menu and insert an `Alert` block! Or highlight text in a paragraph, then change the block type to an `Alert` using the Block Type Select in the Formatting Toolbar!\n\n**Relevant Docs:**\n\n- [Minimal Alert Block Example](/examples/custom-schema/alert-block)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', + }, + { + projectSlug: "toggleable-blocks", + fullSlug: "custom-schema/toggleable-blocks", + pathFromRoot: "examples/06-custom-schema/06-toggleable-blocks", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Basic"], + }, + title: "Toggleable Custom Blocks", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: + "This example shows how to create custom blocks with a toggle button to show/hide their children, like with the default toggle heading and list item blocks. This is done using the use the `ToggleWrapper` component from `@blocknote/react`.\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Default Schema](/docs/features/blocks)", + }, + { + projectSlug: "draggable-inline-content", + fullSlug: "custom-schema/draggable-inline-content", + pathFromRoot: "examples/06-custom-schema/draggable-inline-content", + config: { + playground: true, + docs: false, + author: "hectorzhuang", + tags: [], + }, + title: "Draggable Inline Content", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: "", + }, + { + projectSlug: "react-custom-blocks", + fullSlug: "custom-schema/react-custom-blocks", + pathFromRoot: "examples/06-custom-schema/react-custom-blocks", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Blocks - React API", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: "", + }, + { + projectSlug: "react-custom-inline-content", + fullSlug: "custom-schema/react-custom-inline-content", + pathFromRoot: "examples/06-custom-schema/react-custom-inline-content", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Inline Content - React API", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: "", + }, + { + projectSlug: "react-custom-styles", + fullSlug: "custom-schema/react-custom-styles", + pathFromRoot: "examples/06-custom-schema/react-custom-styles", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Styles - React API", + group: { + pathFromRoot: "examples/06-custom-schema", + slug: "custom-schema", + }, + readme: "", + }, + ], }, - "collaboration": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration", - "projects": [ - { - "projectSlug": "partykit", - "fullSlug": "collaboration/partykit", - "pathFromRoot": "examples/07-collaboration/01-partykit", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Advanced", - "Saving/Loading", - "Collaboration" - ], - "dependencies": { + collaboration: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", + projects: [ + { + projectSlug: "partykit", + fullSlug: "collaboration/partykit", + pathFromRoot: "examples/07-collaboration/01-partykit", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Advanced", "Saving/Loading", "Collaboration"], + dependencies: { "y-partykit": "^0.0.25", - "yjs": "^13.6.27" - } as any + yjs: "^13.6.27", + } as any, }, - "title": "Collaborative Editing with PartyKit", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Collaborative Editing with PartyKit", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, we use PartyKit to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [PartyKit](/docs/features/collaboration#partykit)" + readme: + "In this example, we use PartyKit to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [PartyKit](/docs/features/collaboration#partykit)", }, { - "projectSlug": "liveblocks", - "fullSlug": "collaboration/liveblocks", - "pathFromRoot": "examples/07-collaboration/02-liveblocks", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Advanced", - "Saving/Loading", - "Collaboration" - ], - "dependencies": { + projectSlug: "liveblocks", + fullSlug: "collaboration/liveblocks", + pathFromRoot: "examples/07-collaboration/02-liveblocks", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Advanced", "Saving/Loading", "Collaboration"], + dependencies: { "@liveblocks/client": "^2.23.1", "@liveblocks/react": "^2.23.1", "@liveblocks/react-blocknote": "^2.23.1", "@liveblocks/react-tiptap": "^2.23.1", "@liveblocks/react-ui": "^2.23.1", - "yjs": "^13.6.27" - } as any + yjs: "^13.6.27", + } as any, }, - "title": "Collaborative Editing with Liveblocks", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Collaborative Editing with Liveblocks", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, we use\nthe [Liveblocks + BlockNote setup guide](https://liveblocks.io/docs/get-started/react-blocknote)\nto create a collaborative BlockNote editor, where multiple people can work on\nthe same document in real-time.\n\nUsers can also add comments to the documents to start threads, which are\ndisplayed next to the editor. As well as that, they can react to, reply to, and\nresolve existing comments.\n\n**Try it out:** Open this page in a new browser tab or window to see it in\naction!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Liveblocks](/docs/features/collaboration#liveblocks)\n\n**From Liveblocks Website:**\n\n- [Get Started with BlockNote](https://liveblocks.io/docs/get-started/react-blocknote)\n- [Ready Made Features](https://liveblocks.io/docs/ready-made-features/text-editor/blocknote)\n- [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-react-blocknote)\n- [Advanced Example](https://liveblocks.io/examples/collaborative-text-editor/nextjs-blocknote)" + readme: + "In this example, we use\nthe [Liveblocks + BlockNote setup guide](https://liveblocks.io/docs/get-started/react-blocknote)\nto create a collaborative BlockNote editor, where multiple people can work on\nthe same document in real-time.\n\nUsers can also add comments to the documents to start threads, which are\ndisplayed next to the editor. As well as that, they can react to, reply to, and\nresolve existing comments.\n\n**Try it out:** Open this page in a new browser tab or window to see it in\naction!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Liveblocks](/docs/features/collaboration#liveblocks)\n\n**From Liveblocks Website:**\n\n- [Get Started with BlockNote](https://liveblocks.io/docs/get-started/react-blocknote)\n- [Ready Made Features](https://liveblocks.io/docs/ready-made-features/text-editor/blocknote)\n- [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-react-blocknote)\n- [Advanced Example](https://liveblocks.io/examples/collaborative-text-editor/nextjs-blocknote)", }, { - "projectSlug": "y-sweet", - "fullSlug": "collaboration/y-sweet", - "pathFromRoot": "examples/07-collaboration/03-y-sweet", - "config": { - "playground": true, - "docs": true, - "author": "jakelazaroff", - "tags": [ - "Advanced", - "Saving/Loading", - "Collaboration" - ], - "dependencies": { - "@y-sweet/react": "^0.6.3" - } as any - }, - "title": "Collaborative Editing with Y-Sweet", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" - }, - "readme": "In this example, we use Y-Sweet to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open the [Y-Sweet BlockNote demo](https://demos.y-sweet.dev/blocknote) in multiple browser tabs to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)" - }, - { - "projectSlug": "comments", - "fullSlug": "collaboration/comments", - "pathFromRoot": "examples/07-collaboration/04-comments", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "Advanced", - "Comments", - "Collaboration" - ], - "dependencies": { + projectSlug: "y-sweet", + fullSlug: "collaboration/y-sweet", + pathFromRoot: "examples/07-collaboration/03-y-sweet", + config: { + playground: true, + docs: true, + author: "jakelazaroff", + tags: ["Advanced", "Saving/Loading", "Collaboration"], + dependencies: { "@y-sweet/react": "^0.6.3", - "@mantine/core": "^7.10.1" - } as any + } as any, }, - "title": "Comments & Threads", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Collaborative Editing with Y-Sweet", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text.\n\n**Try it out:** Click the \"Add comment\" button in the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a comment!\n\n**Relevant Docs:**\n\n- [Comments](/docs/features/collaboration/comments)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + "In this example, we use Y-Sweet to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open the [Y-Sweet BlockNote demo](https://demos.y-sweet.dev/blocknote) in multiple browser tabs to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)", }, { - "projectSlug": "comments-with-sidebar", - "fullSlug": "collaboration/comments-with-sidebar", - "pathFromRoot": "examples/07-collaboration/05-comments-with-sidebar", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "Advanced", - "Comments", - "Collaboration" - ], - "dependencies": { + projectSlug: "comments", + fullSlug: "collaboration/comments", + pathFromRoot: "examples/07-collaboration/04-comments", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["Advanced", "Comments", "Collaboration"], + dependencies: { "@y-sweet/react": "^0.6.3", - "@mantine/core": "^7.10.1" - } as any + "@mantine/core": "^7.10.1", + } as any, }, - "title": "Threads Sidebar", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Comments & Threads", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text. The comments are shown in a separate sidebar using the `ThreadsSidebar` component.\n\n**Try it out:** Click the \"Add comment\" button in\nthe [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a\ncomment!\n\n**Relevant Docs:**\n\n- [Comments Sidebar](/docs/features/collaboration/comments#sidebar-view)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + 'In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text.\n\n**Try it out:** Click the "Add comment" button in the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a comment!\n\n**Relevant Docs:**\n\n- [Comments](/docs/features/collaboration/comments)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)', }, { - "projectSlug": "ghost-writer", - "fullSlug": "collaboration/ghost-writer", - "pathFromRoot": "examples/07-collaboration/06-ghost-writer", - "config": { - "playground": true, - "docs": false, - "author": "nperez0111", - "tags": [ - "Advanced", - "Development", - "Collaboration" - ], - "dependencies": { + projectSlug: "comments-with-sidebar", + fullSlug: "collaboration/comments-with-sidebar", + pathFromRoot: "examples/07-collaboration/05-comments-with-sidebar", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["Advanced", "Comments", "Collaboration"], + dependencies: { + "@y-sweet/react": "^0.6.3", + "@mantine/core": "^7.10.1", + } as any, + }, + title: "Threads Sidebar", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", + }, + readme: + 'In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text. The comments are shown in a separate sidebar using the `ThreadsSidebar` component.\n\n**Try it out:** Click the "Add comment" button in\nthe [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a\ncomment!\n\n**Relevant Docs:**\n\n- [Comments Sidebar](/docs/features/collaboration/comments#sidebar-view)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)', + }, + { + projectSlug: "ghost-writer", + fullSlug: "collaboration/ghost-writer", + pathFromRoot: "examples/07-collaboration/06-ghost-writer", + config: { + playground: true, + docs: false, + author: "nperez0111", + tags: ["Advanced", "Development", "Collaboration"], + dependencies: { "y-partykit": "^0.0.25", - "yjs": "^13.6.27" - } as any + yjs: "^13.6.27", + } as any, }, - "title": "Ghost Writer", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Ghost Writer", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, we use a local Yjs document to store the document state, and have a ghost writer that edits the document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" + readme: + "In this example, we use a local Yjs document to store the document state, and have a ghost writer that edits the document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", }, { - "projectSlug": "forking", - "fullSlug": "collaboration/forking", - "pathFromRoot": "examples/07-collaboration/07-forking", - "config": { - "playground": true, - "docs": false, - "author": "nperez0111", - "tags": [ - "Advanced", - "Development", - "Collaboration" - ], - "dependencies": { + projectSlug: "forking", + fullSlug: "collaboration/forking", + pathFromRoot: "examples/07-collaboration/07-forking", + config: { + playground: true, + docs: false, + author: "nperez0111", + tags: ["Advanced", "Development", "Collaboration"], + dependencies: { "y-partykit": "^0.0.25", - "yjs": "^13.6.27" - } as any + yjs: "^13.6.27", + } as any, }, - "title": "Collaborative Editing with Forking", - "group": { - "pathFromRoot": "examples/07-collaboration", - "slug": "collaboration" + title: "Collaborative Editing with Forking", + group: { + pathFromRoot: "examples/07-collaboration", + slug: "collaboration", }, - "readme": "In this example, we can fork a document and edit it independently of other collaborators. Then, we can choose to merge the changes back into the original document, or discard the changes.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" - } - ] + readme: + "In this example, we can fork a document and edit it independently of other collaborators. Then, we can choose to merge the changes back into the original document, or discard the changes.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", + }, + ], }, - "extensions": { - "pathFromRoot": "examples/08-extensions", - "slug": "extensions", - "projects": [ - { - "projectSlug": "tiptap-arrow-conversion", - "fullSlug": "extensions/tiptap-arrow-conversion", - "pathFromRoot": "examples/08-extensions/01-tiptap-arrow-conversion", - "config": { - "playground": true, - "docs": true, - "author": "komsenapati", - "tags": [ - "Extension" - ], - "pro": true, - "dependencies": { - "@tiptap/core": "^2.12.0" - } as any - }, - "title": "TipTap extension (arrow InputRule)", - "group": { - "pathFromRoot": "examples/08-extensions", - "slug": "extensions" - }, - "readme": "This example shows how to set up a BlockNote editor with a TipTap extension that registers an InputRule to convert `->` into `→`.\n\n**Try it out:** Type `->` anywhere in the editor and see how it's automatically converted to a single arrow unicode character." - } - ] + extensions: { + pathFromRoot: "examples/08-extensions", + slug: "extensions", + projects: [ + { + projectSlug: "tiptap-arrow-conversion", + fullSlug: "extensions/tiptap-arrow-conversion", + pathFromRoot: "examples/08-extensions/01-tiptap-arrow-conversion", + config: { + playground: true, + docs: true, + author: "komsenapati", + tags: ["Extension"], + pro: true, + dependencies: { + "@tiptap/core": "^2.12.0", + } as any, + }, + title: "TipTap extension (arrow InputRule)", + group: { + pathFromRoot: "examples/08-extensions", + slug: "extensions", + }, + readme: + "This example shows how to set up a BlockNote editor with a TipTap extension that registers an InputRule to convert `->` into `→`.\n\n**Try it out:** Type `->` anywhere in the editor and see how it's automatically converted to a single arrow unicode character.", + }, + ], }, - "ai": { - "pathFromRoot": "examples/09-ai", - "slug": "ai", - "projects": [ - { - "projectSlug": "minimal", - "fullSlug": "ai/minimal", - "pathFromRoot": "examples/09-ai/01-minimal", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + ai: { + pathFromRoot: "examples/09-ai", + slug: "ai", + projects: [ + { + projectSlug: "minimal", + fullSlug: "ai/minimal", + pathFromRoot: "examples/09-ai/01-minimal", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", - "zustand": "^5.0.3" - } as any - }, - "title": "Rich Text editor AI integration", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "This example shows the minimal setup to add AI integration to your BlockNote rich text editor.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)" - }, - { - "projectSlug": "playground", - "fullSlug": "ai/playground", - "pathFromRoot": "examples/09-ai/02-playground", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + ai: "^5.0.29", + "@ai-sdk/groq": "^2.0.16", + zustand: "^5.0.3", + } as any, + }, + title: "Rich Text editor AI integration", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "This example shows the minimal setup to add AI integration to your BlockNote rich text editor.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)", + }, + { + projectSlug: "playground", + fullSlug: "ai/playground", + pathFromRoot: "examples/09-ai/02-playground", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/google": "^1.2.20", - "@ai-sdk/openai": "^1.3.22", - "@ai-sdk/openai-compatible": "^0.2.14", - "@ai-sdk/groq": "^1.2.9", - "@ai-sdk/anthropic": "^1.2.11", - "@ai-sdk/mistral": "^1.2.8", - "zustand": "^5.0.3" - } as any - }, - "title": "AI Playground", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "The AI Playground example shows how to customize different options of the AI Extension such as model type and streaming mode.\n\nChange the configuration, the highlight some text to access the AI menu, or type `/ai` anywhere in the editor.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [BlockNote AI Reference](/docs/features/ai/reference)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)" - }, - { - "projectSlug": "custom-ai-menu-items", - "fullSlug": "ai/custom-ai-menu-items", - "pathFromRoot": "examples/09-ai/03-custom-ai-menu-items", - "config": { - "playground": true, - "docs": true, - "author": "matthewlipski", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + ai: "^5.0.29", + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/mistral": "^2.0.12", + zustand: "^5.0.3", + } as any, + }, + title: "AI Playground", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "The AI Playground example shows how to customize different options of the AI Extension such as model type and streaming mode.\n\nChange the configuration, the highlight some text to access the AI menu, or type `/ai` anywhere in the editor.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [BlockNote AI Reference](/docs/features/ai/reference)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)", + }, + { + projectSlug: "custom-ai-menu-items", + fullSlug: "ai/custom-ai-menu-items", + pathFromRoot: "examples/09-ai/03-custom-ai-menu-items", + config: { + playground: true, + docs: true, + author: "matthewlipski", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.1.0", - "@ai-sdk/openai": "^1.1.0", - "@ai-sdk/groq": "^1.1.0", + ai: "^4.1.0", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", - "zustand": "^5.0.3" - } as any - }, - "title": "Adding AI Menu Items", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "In this example, we add two items to the AI Menu. The first prompts the AI to make the selected text more casual, and can be found by selecting some text and click the AI (stars) button. The second prompts the AI to give ideas on related topics to extend the document with, and can be found by clicking the \"Ask AI\" Slash Menu item.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Custom AI Menu Items](/docs/features/ai/custom-commands)" - }, - { - "projectSlug": "with-collaboration", - "fullSlug": "ai/with-collaboration", - "pathFromRoot": "examples/09-ai/04-with-collaboration", - "config": { - "playground": true, - "docs": false, - "author": "nperez0111", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + zustand: "^5.0.3", + } as any, + }, + title: "Adding AI Menu Items", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + 'In this example, we add two items to the AI Menu. The first prompts the AI to make the selected text more casual, and can be found by selecting some text and click the AI (stars) button. The second prompts the AI to give ideas on related topics to extend the document with, and can be found by clicking the "Ask AI" Slash Menu item.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Custom AI Menu Items](/docs/features/ai/custom-commands)', + }, + { + projectSlug: "with-collaboration", + fullSlug: "ai/with-collaboration", + pathFromRoot: "examples/09-ai/04-with-collaboration", + config: { + playground: true, + docs: false, + author: "nperez0111", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + ai: "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", - "yjs": "^13.6.27", - "zustand": "^5.0.3" - } as any - }, - "title": "AI + Ghost Writer", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)\n- [Getting Stared with BlockNote AI](/docs/features/ai/setup)" - }, - { - "projectSlug": "manual-execution", - "fullSlug": "ai/manual-execution", - "pathFromRoot": "examples/09-ai/05-manual-execution", - "config": { - "playground": true, - "docs": false, - "author": "yousefed", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + yjs: "^13.6.27", + zustand: "^5.0.3", + } as any, + }, + title: "AI + Ghost Writer", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)\n- [Getting Stared with BlockNote AI](/docs/features/ai/setup)", + }, + { + projectSlug: "manual-execution", + fullSlug: "ai/manual-execution", + pathFromRoot: "examples/09-ai/05-manual-execution", + config: { + playground: true, + docs: false, + author: "yousefed", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "@ai-sdk/groq": "^1.2.9", + ai: "^5.0.29", + "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", - "yjs": "^13.6.27", - "zustand": "^5.0.3" - } as any - }, - "title": "AI manual execution", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor" - }, - { - "projectSlug": "server-execution", - "fullSlug": "ai/server-execution", - "pathFromRoot": "examples/09-ai/06-server-execution", - "config": { - "playground": true, - "docs": true, - "author": "yousefed", - "tags": [ - "AI", - "llm" - ], - "dependencies": { + yjs: "^13.6.27", + zustand: "^5.0.3", + } as any, + }, + title: "AI manual execution", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor", + }, + { + projectSlug: "server-execution", + fullSlug: "ai/server-execution", + pathFromRoot: "examples/09-ai/06-server-execution", + config: { + playground: true, + docs: true, + author: "yousefed", + tags: ["AI", "llm"], + dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.3.15", - "zustand": "^5.0.3" - } as any - }, - "title": "AI Integration with server LLM execution", - "group": { - "pathFromRoot": "examples/09-ai", - "slug": "ai" - }, - "readme": "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor" - } - ] + ai: "^5.0.29", + zustand: "^5.0.3", + } as any, + }, + title: "AI Integration with server LLM execution", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor", + }, + ], }, "vanilla-js": { - "pathFromRoot": "examples/vanilla-js", - "slug": "vanilla-js", - "projects": [ - { - "projectSlug": "react-vanilla-custom-blocks", - "fullSlug": "vanilla-js/react-vanilla-custom-blocks", - "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-blocks", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Blocks - Vanilla JS API", - "group": { - "pathFromRoot": "examples/vanilla-js", - "slug": "vanilla-js" - }, - "readme": "" - }, - { - "projectSlug": "react-vanilla-custom-inline-content", - "fullSlug": "vanilla-js/react-vanilla-custom-inline-content", - "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-inline-content", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Inline Content - Vanilla JS API", - "group": { - "pathFromRoot": "examples/vanilla-js", - "slug": "vanilla-js" - }, - "readme": "" - }, - { - "projectSlug": "react-vanilla-custom-styles", - "fullSlug": "vanilla-js/react-vanilla-custom-styles", - "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-styles", - "config": { - "playground": true, - "docs": false, - "author": "matthewlipski", - "tags": [] - }, - "title": "Custom Styles - Vanilla JS API", - "group": { - "pathFromRoot": "examples/vanilla-js", - "slug": "vanilla-js" - }, - "readme": "" - } - ] - } -}; \ No newline at end of file + pathFromRoot: "examples/vanilla-js", + slug: "vanilla-js", + projects: [ + { + projectSlug: "react-vanilla-custom-blocks", + fullSlug: "vanilla-js/react-vanilla-custom-blocks", + pathFromRoot: "examples/vanilla-js/react-vanilla-custom-blocks", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Blocks - Vanilla JS API", + group: { + pathFromRoot: "examples/vanilla-js", + slug: "vanilla-js", + }, + readme: "", + }, + { + projectSlug: "react-vanilla-custom-inline-content", + fullSlug: "vanilla-js/react-vanilla-custom-inline-content", + pathFromRoot: "examples/vanilla-js/react-vanilla-custom-inline-content", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Inline Content - Vanilla JS API", + group: { + pathFromRoot: "examples/vanilla-js", + slug: "vanilla-js", + }, + readme: "", + }, + { + projectSlug: "react-vanilla-custom-styles", + fullSlug: "vanilla-js/react-vanilla-custom-styles", + pathFromRoot: "examples/vanilla-js/react-vanilla-custom-styles", + config: { + playground: true, + docs: false, + author: "matthewlipski", + tags: [], + }, + title: "Custom Styles - Vanilla JS API", + group: { + pathFromRoot: "examples/vanilla-js", + slug: "vanilla-js", + }, + readme: "", + }, + ], + }, +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef1729579c..6ec650127a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,23 +60,23 @@ importers: docs: dependencies: '@ai-sdk/anthropic': - specifier: ^1.2.11 - version: 1.2.12(zod@3.25.76) + specifier: ^2.0.9 + version: 2.0.9(zod@3.25.76) '@ai-sdk/google': - specifier: ^1.2.20 - version: 1.2.20(zod@3.25.76) + specifier: ^2.0.11 + version: 2.0.11(zod@3.25.76) '@ai-sdk/groq': - specifier: ^1.1.0 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@ai-sdk/mistral': - specifier: ^1.2.8 - version: 1.2.8(zod@3.25.76) + specifier: ^2.0.12 + version: 2.0.12(zod@3.25.76) '@ai-sdk/openai': - specifier: ^1.1.0 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@ai-sdk/openai-compatible': - specifier: ^0.2.14 - version: 0.2.14(zod@3.25.76) + specifier: ^1.0.13 + version: 1.0.13(zod@3.25.76) '@aws-sdk/client-s3': specifier: ^3.609.0 version: 3.775.0 @@ -225,8 +225,8 @@ importers: specifier: ^0.6.3 version: 0.6.4(react@19.1.0)(yjs@13.6.27) ai: - specifier: ^4.3.15 - version: 4.3.19(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) babel-plugin-react-compiler: specifier: 19.1.0-rc.2 version: 19.1.0-rc.2 @@ -3071,8 +3071,8 @@ importers: examples/09-ai/01-minimal: dependencies: '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3095,8 +3095,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.3.15 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3123,23 +3123,23 @@ importers: examples/09-ai/02-playground: dependencies: '@ai-sdk/anthropic': - specifier: ^1.2.11 - version: 1.2.11(zod@3.25.76) + specifier: ^2.0.9 + version: 2.0.9(zod@3.25.76) '@ai-sdk/google': - specifier: ^1.2.20 - version: 1.2.20(zod@3.25.76) + specifier: ^2.0.11 + version: 2.0.11(zod@3.25.76) '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@ai-sdk/mistral': - specifier: ^1.2.8 - version: 1.2.8(zod@3.25.76) + specifier: ^2.0.12 + version: 2.0.12(zod@3.25.76) '@ai-sdk/openai': - specifier: ^1.3.22 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@ai-sdk/openai-compatible': - specifier: ^0.2.14 - version: 0.2.14(zod@3.25.76) + specifier: ^1.0.13 + version: 1.0.13(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3162,8 +3162,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.3.15 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3190,11 +3190,11 @@ importers: examples/09-ai/03-custom-ai-menu-items: dependencies: '@ai-sdk/groq': - specifier: ^1.1.0 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@ai-sdk/openai': - specifier: ^1.1.0 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3248,8 +3248,8 @@ importers: examples/09-ai/04-with-collaboration: dependencies: '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3272,8 +3272,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.3.15 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3306,8 +3306,8 @@ importers: examples/09-ai/05-manual-execution: dependencies: '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3330,8 +3330,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.3.15 - version: 4.3.19(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3385,8 +3385,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.3.15 - version: 4.3.19(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -4120,8 +4120,8 @@ importers: packages/xl-ai: dependencies: '@ai-sdk/provider-utils': - specifier: ^2.2.8 - version: 2.2.8(zod@3.25.76) + specifier: ^3.0.7 + version: 3.0.7(zod@3.25.76) '@ai-sdk/ui-utils': specifier: ^1.2.11 version: 1.2.11(zod@3.25.76) @@ -4144,8 +4144,8 @@ importers: specifier: ^2.12.0 version: 2.12.0(@tiptap/pm@2.12.0) ai: - specifier: ^4.3.19 - version: 4.3.19(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) lodash.isequal: specifier: ^4.5.0 version: 4.5.0 @@ -4193,23 +4193,23 @@ importers: version: 5.0.3(@types/react@19.1.8)(immer@10.1.1)(react@19.1.0)(use-sync-external-store@1.5.0(react@19.1.0)) devDependencies: '@ai-sdk/anthropic': - specifier: ^1.2.12 - version: 1.2.12(zod@3.25.76) + specifier: ^2.0.9 + version: 2.0.9(zod@3.25.76) '@ai-sdk/google': - specifier: ^1.2.20 - version: 1.2.20(zod@3.25.76) + specifier: ^2.0.11 + version: 2.0.11(zod@3.25.76) '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@ai-sdk/mistral': - specifier: ^1.2.8 - version: 1.2.8(zod@3.25.76) + specifier: ^2.0.12 + version: 2.0.12(zod@3.25.76) '@ai-sdk/openai': - specifier: ^1.3.22 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@ai-sdk/openai-compatible': - specifier: ^0.2.14 - version: 0.2.14(zod@3.25.76) + specifier: ^1.0.13 + version: 1.0.13(zod@3.25.76) '@mswjs/interceptors': specifier: ^0.37.5 version: 0.37.6 @@ -4280,8 +4280,8 @@ importers: packages/xl-ai-server: dependencies: '@ai-sdk/openai': - specifier: ^1.3.22 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@blocknote/xl-ai': specifier: workspace:* version: link:../xl-ai @@ -4289,8 +4289,8 @@ importers: specifier: ^1.13.7 version: 1.14.0(hono@4.7.5) ai: - specifier: ^4 - version: 4.3.19(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) hono: specifier: ^4.6.12 version: 4.7.5 @@ -4631,23 +4631,23 @@ importers: playground: dependencies: '@ai-sdk/anthropic': - specifier: ^1.2.11 - version: 1.2.11(zod@3.25.76) + specifier: ^2.0.9 + version: 2.0.9(zod@3.25.76) '@ai-sdk/google': - specifier: ^1.2.20 - version: 1.2.20(zod@3.25.76) + specifier: ^2.0.11 + version: 2.0.11(zod@3.25.76) '@ai-sdk/groq': - specifier: ^1.2.9 - version: 1.2.9(zod@3.25.76) + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@ai-sdk/mistral': - specifier: ^1.2.8 - version: 1.2.8(zod@3.25.76) + specifier: ^2.0.12 + version: 2.0.12(zod@3.25.76) '@ai-sdk/openai': - specifier: ^1.3.22 - version: 1.3.22(zod@3.25.76) + specifier: ^2.0.23 + version: 2.0.23(zod@3.25.76) '@ai-sdk/openai-compatible': - specifier: ^0.2.14 - version: 0.2.14(zod@3.25.76) + specifier: ^1.0.13 + version: 1.0.13(zod@3.25.76) '@aws-sdk/client-s3': specifier: ^3.609.0 version: 3.775.0 @@ -4760,8 +4760,8 @@ importers: specifier: ^0.6.3 version: 0.6.4(react@19.1.0)(yjs@13.6.27) ai: - specifier: ^4.3.15 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) autoprefixer: specifier: 10.4.21 version: 10.4.21(postcss@8.5.6) @@ -4905,47 +4905,47 @@ importers: packages: - '@ai-sdk/anthropic@1.2.11': - resolution: {integrity: sha512-lZLcEMh8MXY4NVSrN/7DyI2rnid8k7cn/30nMmd3bwJrnIsOuIuuFvY8f0nj+pFcTi6AYK7ujLdqW5dQVz1YQw==} + '@ai-sdk/anthropic@2.0.9': + resolution: {integrity: sha512-1kQgL2A3PeqfEcHHmqy4NxRc8rbgLS71bHBuvDFfDz3VAAyndkilPMCLNDSP2mJVGAej2EMWJ1sShRAxzn70jA==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/anthropic@1.2.12': - resolution: {integrity: sha512-YSzjlko7JvuiyQFmI9RN1tNZdEiZxc+6xld/0tq/VkJaHpEzGAb1yiNxxvmYVcjvfu/PcvCxAAYXmTYQQ63IHQ==} + '@ai-sdk/gateway@1.0.15': + resolution: {integrity: sha512-xySXoQ29+KbGuGfmDnABx+O6vc7Gj7qugmj1kGpn0rW0rQNn6UKUuvscKMzWyv1Uv05GyC1vqHq8ZhEOLfXscQ==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/google@1.2.20': - resolution: {integrity: sha512-XJcJPazNmvd1WQ/CHS17EDiJs1kPU0eakOgBin0o1DgXsnhX9OKdDxz+tgtriWE8HliN9edU0mhzMiiraz7EQA==} + '@ai-sdk/google@2.0.11': + resolution: {integrity: sha512-dnVIgSz1DZD/0gVau6ifYN3HZFN15HZwC9VjevTFfvrfSfbEvpXj5x/k/zk/0XuQrlQ5g8JiwJtxc9bx24x2xw==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/groq@1.2.9': - resolution: {integrity: sha512-7MoDaxm8yWtiRbD1LipYZG0kBl+Xe0sv/EeyxnHnGPZappXdlgtdOgTZVjjXkT3nWP30jjZi9A45zoVrBMb3Xg==} + '@ai-sdk/groq@2.0.16': + resolution: {integrity: sha512-oW/bty0qy56jq4bOhu8IXPDovZyAn73bQVblIwpOMyruAO9CjGMncZmcSju68ZXwT/im8+qUq/vVFLqjdHgHig==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/mistral@1.2.8': - resolution: {integrity: sha512-lv857D9UJqCVxiq2Fcu7mSPTypEHBUqLl1K+lCaP6X/7QAkcaxI36QDONG+tOhGHJOXTsS114u8lrUTaEiGXbg==} + '@ai-sdk/mistral@2.0.12': + resolution: {integrity: sha512-o5q253v7yGqB8YeyITEYe2Wt6iG3p1whdPdlZL2SfkE3bwWqjMzqx6GWqpXyGYeFUw5I8IF1squgHo+wWmU8IQ==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/openai-compatible@0.2.14': - resolution: {integrity: sha512-icjObfMCHKSIbywijaoLdZ1nSnuRnWgMEMLgwoxPJgxsUHMx0aVORnsLUid4SPtdhHI3X2masrt6iaEQLvOSFw==} + '@ai-sdk/openai-compatible@1.0.13': + resolution: {integrity: sha512-g46fLVWKcVg1XOFzDLoJ0XuhtY5XxxBwMQ0FT/aHwCtg6WUvk3Elrd+MKmgfvhZAdIR7CpUTvgJAAipu4RW75w==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 - '@ai-sdk/openai@1.3.22': - resolution: {integrity: sha512-QwA+2EkG0QyjVR+7h6FE7iOu2ivNqAVMm9UJZkVxxTk5OIq5fFJDTEI/zICEMuHImTTXR2JjsL6EirJ28Jc4cw==} + '@ai-sdk/openai@2.0.23': + resolution: {integrity: sha512-uOXk8HzmMUoCmD0JMX/Y1HC/ABOR/Jza2Z2rkCaJISDYz3fp5pnb6eNjcPRL48JSMzRAGp9UP5p0OpxS06IJZg==} engines: {node: '>=18'} peerDependencies: - zod: ^3.0.0 + zod: ^3.25.76 || ^4 '@ai-sdk/provider-utils@2.2.8': resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==} @@ -4953,10 +4953,20 @@ packages: peerDependencies: zod: ^3.23.8 + '@ai-sdk/provider-utils@3.0.7': + resolution: {integrity: sha512-o3BS5/t8KnBL3ubP8k3w77AByOypLm+pkIL/DCw0qKkhDbvhCy+L3hRTGPikpdb8WHcylAeKsjgwOxhj4cqTUA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4 + '@ai-sdk/provider@1.1.3': resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==} engines: {node: '>=18'} + '@ai-sdk/provider@2.0.0': + resolution: {integrity: sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==} + engines: {node: '>=18'} + '@ai-sdk/react@1.2.12': resolution: {integrity: sha512-jK1IZZ22evPZoQW3vlkZ7wvjYGYF+tRBKXtrcolduIkQ/m/sOAVcVeVDUDvh1T91xCnWCdUGCPZg2avZ90mv3g==} engines: {node: '>=18'} @@ -9932,15 +9942,11 @@ packages: react: optional: true - ai@4.3.19: - resolution: {integrity: sha512-dIE2bfNpqHN3r6IINp9znguYdhIOheKW2LDigAMrgt/upT3B8eBGPSCblENvaZGoq+hxaN9fSMzjWpbqloP+7Q==} + ai@5.0.29: + resolution: {integrity: sha512-jA/d6X5hn3r/PxgZjwzDUMJiEkLBIVVD2gcbpcT/FD4MSLxm5sn6fH1y2VFXVgBEd95mNzQ8ALQubysc6E8Y9g==} engines: {node: '>=18'} peerDependencies: - react: ^18 || ^19 || ^19.0.0-rc - zod: ^3.23.8 - peerDependenciesMeta: - react: - optional: true + zod: ^3.25.76 || ^4 ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} @@ -11148,6 +11154,10 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + eventsource-parser@3.0.6: + resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} + engines: {node: '>=18.0.0'} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -15349,46 +15359,46 @@ packages: snapshots: - '@ai-sdk/anthropic@1.2.11(zod@3.25.76)': + '@ai-sdk/anthropic@2.0.9(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/anthropic@1.2.12(zod@3.25.76)': + '@ai-sdk/gateway@1.0.15(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/google@1.2.20(zod@3.25.76)': + '@ai-sdk/google@2.0.11(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/groq@1.2.9(zod@3.25.76)': + '@ai-sdk/groq@2.0.16(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/mistral@1.2.8(zod@3.25.76)': + '@ai-sdk/mistral@2.0.12(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/openai-compatible@0.2.14(zod@3.25.76)': + '@ai-sdk/openai-compatible@1.0.13(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/openai@1.3.22(zod@3.25.76)': + '@ai-sdk/openai@2.0.23(zod@3.25.76)': dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 '@ai-sdk/provider-utils@2.2.8(zod@3.25.76)': @@ -15398,10 +15408,21 @@ snapshots: secure-json-parse: 2.7.0 zod: 3.25.76 + '@ai-sdk/provider-utils@3.0.7(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 2.0.0 + '@standard-schema/spec': 1.0.0 + eventsource-parser: 3.0.6 + zod: 3.25.76 + '@ai-sdk/provider@1.1.3': dependencies: json-schema: 0.4.0 + '@ai-sdk/provider@2.0.0': + dependencies: + json-schema: 0.4.0 + '@ai-sdk/react@1.2.12(react@19.1.0)(zod@3.25.76)': dependencies: '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) @@ -21206,17 +21227,13 @@ snapshots: optionalDependencies: react: 19.1.0 - ai@4.3.19(react@19.1.0)(zod@3.25.76): + ai@5.0.29(zod@3.25.76): dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/react': 1.2.12(react@19.1.0)(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) + '@ai-sdk/gateway': 1.0.15(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) '@opentelemetry/api': 1.9.0 - jsondiffpatch: 0.6.0 zod: 3.25.76 - optionalDependencies: - react: 19.1.0 ajv-formats@2.1.1(ajv@8.17.1): optionalDependencies: @@ -22711,6 +22728,8 @@ snapshots: events@3.3.0: {} + eventsource-parser@3.0.6: {} + execa@5.1.1: dependencies: cross-spawn: 7.0.6 From b79d8bb0a3be47da9421fe780b45bb9ade81c0ef Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 11:46:12 +0200 Subject: [PATCH 11/68] clean packages remaining --- .../03-custom-ai-menu-items/.bnexample.json | 2 +- .../03-custom-ai-menu-items/package.json | 2 +- packages/xl-ai/package.json | 1 - pnpm-lock.yaml | 135 +----------------- 4 files changed, 4 insertions(+), 136 deletions(-) diff --git a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json index 96eee14a8f..2330041730 100644 --- a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json +++ b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.1.0", + "ai": "^5.0.29", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", diff --git a/examples/09-ai/03-custom-ai-menu-items/package.json b/examples/09-ai/03-custom-ai-menu-items/package.json index 0ae67658ad..4a1a61f87c 100644 --- a/examples/09-ai/03-custom-ai-menu-items/package.json +++ b/examples/09-ai/03-custom-ai-menu-items/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^4.1.0", + "ai": "^5.0.29", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index ea123569ca..1dae24482a 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -71,7 +71,6 @@ "@floating-ui/react": "^0.26.4", "@tiptap/core": "^2.12.0", "ai": "^5.0.29", - "@ai-sdk/ui-utils": "^1.2.11", "@ai-sdk/provider-utils": "^3.0.7", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ec650127a..42c2387e7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3217,8 +3217,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^4.1.0 - version: 4.3.15(react@19.1.0)(zod@3.25.76) + specifier: ^5.0.29 + version: 5.0.29(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -4122,9 +4122,6 @@ importers: '@ai-sdk/provider-utils': specifier: ^3.0.7 version: 3.0.7(zod@3.25.76) - '@ai-sdk/ui-utils': - specifier: ^1.2.11 - version: 1.2.11(zod@3.25.76) '@blocknote/core': specifier: 0.35.0 version: link:../core @@ -4947,42 +4944,16 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 - '@ai-sdk/provider-utils@2.2.8': - resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.23.8 - '@ai-sdk/provider-utils@3.0.7': resolution: {integrity: sha512-o3BS5/t8KnBL3ubP8k3w77AByOypLm+pkIL/DCw0qKkhDbvhCy+L3hRTGPikpdb8WHcylAeKsjgwOxhj4cqTUA==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4 - '@ai-sdk/provider@1.1.3': - resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==} - engines: {node: '>=18'} - '@ai-sdk/provider@2.0.0': resolution: {integrity: sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==} engines: {node: '>=18'} - '@ai-sdk/react@1.2.12': - resolution: {integrity: sha512-jK1IZZ22evPZoQW3vlkZ7wvjYGYF+tRBKXtrcolduIkQ/m/sOAVcVeVDUDvh1T91xCnWCdUGCPZg2avZ90mv3g==} - engines: {node: '>=18'} - peerDependencies: - react: ^18 || ^19 || ^19.0.0-rc - zod: ^3.23.8 - peerDependenciesMeta: - zod: - optional: true - - '@ai-sdk/ui-utils@1.2.11': - resolution: {integrity: sha512-3zcwCc8ezzFlwp3ZD15wAPjf2Au4s3vAbKsXQVyhxODHcmu0iyPO2Eua6D/vicq/AUm/BAo60r97O6HU+EI0+w==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.23.8 - '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -9368,9 +9339,6 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} - '@types/diff-match-patch@1.0.36': - resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==} - '@types/diff@6.0.0': resolution: {integrity: sha512-dhVCYGv3ZSbzmQaBSagrv1WJ6rXCdkyTcDyoNu1MD8JohI7pR7k8wdZEm+mvdxRKXyHVwckFzWU1vJc+Z29MlA==} @@ -9932,16 +9900,6 @@ packages: resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} - ai@4.3.15: - resolution: {integrity: sha512-TYKRzbWg6mx/pmTadlAEIhuQtzfHUV0BbLY72+zkovXwq/9xhcH24IlQmkyBpElK6/4ArS0dHdOOtR1jOPVwtg==} - engines: {node: '>=18'} - peerDependencies: - react: ^18 || ^19 || ^19.0.0-rc - zod: ^3.23.8 - peerDependenciesMeta: - react: - optional: true - ai@5.0.29: resolution: {integrity: sha512-jA/d6X5hn3r/PxgZjwzDUMJiEkLBIVVD2gcbpcT/FD4MSLxm5sn6fH1y2VFXVgBEd95mNzQ8ALQubysc6E8Y9g==} engines: {node: '>=18'} @@ -10765,9 +10723,6 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - diff-match-patch@1.0.5: - resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==} - diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -12167,11 +12122,6 @@ packages: jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - jsondiffpatch@0.6.0: - resolution: {integrity: sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} @@ -14067,9 +14017,6 @@ packages: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} engines: {node: '>=4'} - secure-json-parse@2.7.0: - resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} - selderee@0.11.0: resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} @@ -14415,11 +14362,6 @@ packages: svg-arc-to-cubic-bezier@3.2.0: resolution: {integrity: sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==} - swr@2.3.3: - resolution: {integrity: sha512-dshNvs3ExOqtZ6kJBaAsabhPdHyeY4P2cKwRCniDVifBMoG/SVI7tfLWqPXriVspf2Rg4tPzXJTnwaihIeFw2A==} - peerDependencies: - react: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -14499,10 +14441,6 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - throttleit@2.1.0: - resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==} - engines: {node: '>=18'} - tiny-inflate@1.0.3: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} @@ -15325,11 +15263,6 @@ packages: youch@3.3.4: resolution: {integrity: sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==} - zod-to-json-schema@3.24.5: - resolution: {integrity: sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==} - peerDependencies: - zod: ^3.24.1 - zod@3.24.2: resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==} @@ -15401,13 +15334,6 @@ snapshots: '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/provider-utils@2.2.8(zod@3.25.76)': - dependencies: - '@ai-sdk/provider': 1.1.3 - nanoid: 3.3.11 - secure-json-parse: 2.7.0 - zod: 3.25.76 - '@ai-sdk/provider-utils@3.0.7(zod@3.25.76)': dependencies: '@ai-sdk/provider': 2.0.0 @@ -15415,31 +15341,10 @@ snapshots: eventsource-parser: 3.0.6 zod: 3.25.76 - '@ai-sdk/provider@1.1.3': - dependencies: - json-schema: 0.4.0 - '@ai-sdk/provider@2.0.0': dependencies: json-schema: 0.4.0 - '@ai-sdk/react@1.2.12(react@19.1.0)(zod@3.25.76)': - dependencies: - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) - react: 19.1.0 - swr: 2.3.3(react@19.1.0) - throttleit: 2.1.0 - optionalDependencies: - zod: 3.25.76 - - '@ai-sdk/ui-utils@1.2.11(zod@3.25.76)': - dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - zod: 3.25.76 - zod-to-json-schema: 3.24.5(zod@3.25.76) - '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -20505,8 +20410,6 @@ snapshots: dependencies: '@types/ms': 2.1.0 - '@types/diff-match-patch@1.0.36': {} - '@types/diff@6.0.0': {} '@types/emoji-mart@3.0.14': @@ -21215,18 +21118,6 @@ snapshots: agent-base@7.1.3: {} - ai@4.3.15(react@19.1.0)(zod@3.25.76): - dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.76) - '@ai-sdk/react': 1.2.12(react@19.1.0)(zod@3.25.76) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.76) - '@opentelemetry/api': 1.9.0 - jsondiffpatch: 0.6.0 - zod: 3.25.76 - optionalDependencies: - react: 19.1.0 - ai@5.0.29(zod@3.25.76): dependencies: '@ai-sdk/gateway': 1.0.15(zod@3.25.76) @@ -22108,8 +21999,6 @@ snapshots: didyoumean@1.2.2: {} - diff-match-patch@1.0.5: {} - diff-sequences@29.6.3: {} diff@5.2.0: {} @@ -23944,12 +23833,6 @@ snapshots: jsonc-parser@3.2.0: {} - jsondiffpatch@0.6.0: - dependencies: - '@types/diff-match-patch': 1.0.36 - chalk: 5.4.1 - diff-match-patch: 1.0.5 - jsx-ast-utils@3.3.5: dependencies: array-includes: 3.1.8 @@ -26406,8 +26289,6 @@ snapshots: extend-shallow: 2.0.1 kind-of: 6.0.3 - secure-json-parse@2.7.0: {} - selderee@0.11.0: dependencies: parseley: 0.12.1 @@ -26850,12 +26731,6 @@ snapshots: svg-arc-to-cubic-bezier@3.2.0: {} - swr@2.3.3(react@19.1.0): - dependencies: - dequal: 2.0.3 - react: 19.1.0 - use-sync-external-store: 1.5.0(react@19.1.0) - symbol-tree@3.2.4: {} system-architecture@0.1.0: {} @@ -26961,8 +26836,6 @@ snapshots: dependencies: any-promise: 1.3.0 - throttleit@2.1.0: {} - tiny-inflate@1.0.3: {} tiny-invariant@1.3.1: {} @@ -27957,10 +27830,6 @@ snapshots: mustache: 4.2.0 stacktracey: 2.1.8 - zod-to-json-schema@3.24.5(zod@3.25.76): - dependencies: - zod: 3.25.76 - zod@3.24.2: {} zod@3.25.76: {} From 008571df9df6d107fa77c17436af16ee330e06fe Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 11:51:49 +0200 Subject: [PATCH 12/68] first bach of codemods --- docs/source.config.ts | 2 +- packages/xl-ai/src/api/LLMRequest.ts | 6 +++--- packages/xl-ai/src/api/LLMResponse.ts | 4 ++-- packages/xl-ai/src/api/formats/PromptBuilder.ts | 6 +++--- .../src/api/formats/base-tools/createAddBlocksTool.ts | 2 +- .../src/api/formats/base-tools/createUpdateBlockTool.ts | 2 +- packages/xl-ai/src/api/formats/base-tools/delete.ts | 2 +- .../api/formats/html-blocks/defaultHTMLPromptBuilder.ts | 6 +++--- .../src/api/formats/json/defaultJSONPromptBuilder.ts | 8 ++++---- .../markdown-blocks/defaultMarkdownPromptBuilder.ts | 6 +++--- packages/xl-ai/src/streamTool/asTool.ts | 4 ++-- packages/xl-ai/src/streamTool/jsonSchema.ts | 2 +- packages/xl-ai/src/streamTool/streamTool.ts | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/source.config.ts b/docs/source.config.ts index f5701cab86..9f81d31c63 100644 --- a/docs/source.config.ts +++ b/docs/source.config.ts @@ -8,7 +8,7 @@ import { transformerTwoslash } from "fumadocs-twoslash"; import { createFileSystemTypesCache } from "fumadocs-twoslash/cache-fs"; import { createGenerator, remarkAutoTypeTable } from "fumadocs-typescript"; import { bundledLanguages, getSingletonHighlighter } from "shiki"; -import { z } from "zod"; +import { z } from 'zod/v3'; const generator = createGenerator(); // suggested here: https://github.com/fuma-nama/fumadocs/issues/1095#issuecomment-2495855920 diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index 006e9d5028..da260f3b80 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,5 +1,5 @@ import { BlockNoteEditor } from "@blocknote/core"; -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; import { StreamTool } from "../streamTool/streamTool.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; @@ -11,7 +11,7 @@ import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; type MakeOptional = Omit & Partial>; export type ExecuteLLMRequestOptions = { - messages: CoreMessage[]; + messages: ModelMessage[]; streamTools: StreamTool[]; // TODO: needed? llmRequestOptions: MakeOptional; @@ -143,7 +143,7 @@ export async function doLLMRequest( ? editor.getSelectionCutBlocks() : undefined; - let previousMessages: CoreMessage[] | undefined = undefined; + let previousMessages: ModelMessage[] | undefined = undefined; if (previousResponse) { previousMessages = previousResponse.messages.map((m) => { diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts index 7dcfc73501..2c0aaa1567 100644 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -1,4 +1,4 @@ -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; import { StreamToolExecutor } from "../streamTool/StreamToolExecutor.js"; import { AsyncIterableStream } from "../util/stream.js"; @@ -39,7 +39,7 @@ export class LLMResponse { /** * The messages sent to the LLM */ - public readonly messages: CoreMessage[], + public readonly messages: ModelMessage[], /** * Result of the underlying LLM call. Use this to access operations the LLM decided to execute, but without applying them. * (usually this is only used for advanced used cases or debugging) diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index c52c47bb0e..01aa1c4ce0 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -1,5 +1,5 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; /* We want users to be able to easily customize the prompts send to an LLM, @@ -33,7 +33,7 @@ export type PromptBuilderInput = { * When following a multi-step conversation, or repairing a previous error, * the previous messages that have been sent to the LLM */ - previousMessages?: Array; + previousMessages?: Array; }; /** @@ -43,4 +43,4 @@ export type PromptBuilderInput = { export type PromptBuilder = ( editor: BlockNoteEditor, opts: PromptBuilderInput, -) => Promise>; +) => Promise>; diff --git a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts index 6c1eca51db..437ce912e8 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts @@ -84,7 +84,7 @@ export function createAddBlocksTool(config: { return streamTool>({ name: "add", description: config.description, - parameters: { + inputSchema: { type: "object", properties: { referenceId: { diff --git a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts index f3a16f7a3d..9fc3e85ba6 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts @@ -98,7 +98,7 @@ export function createUpdateBlockTool(config: { return streamTool>({ name: "update", description: config.description, - parameters: { + inputSchema: { type: "object", properties: { id: { diff --git a/packages/xl-ai/src/api/formats/base-tools/delete.ts b/packages/xl-ai/src/api/formats/base-tools/delete.ts index 3f96642c65..d876865323 100644 --- a/packages/xl-ai/src/api/formats/base-tools/delete.ts +++ b/packages/xl-ai/src/api/formats/base-tools/delete.ts @@ -20,7 +20,7 @@ export const deleteBlockTool = ( streamTool({ name: "delete", description: "Delete a block", - parameters: { + inputSchema: { type: "object", properties: { id: { diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index 7fe83e758f..06dd40146e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -1,4 +1,4 @@ -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import type { PromptBuilder } from "../PromptBuilder.js"; import { @@ -16,7 +16,7 @@ function promptManipulateSelectionHTMLBlocks(opts: { block: string; }[]; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", @@ -61,7 +61,7 @@ function promptManipulateDocumentUseHTMLBlocks(opts: { } >; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", diff --git a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts index 0b1d7324be..f1f2493a3b 100644 --- a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts @@ -1,4 +1,4 @@ -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import { PromptBuilder } from "../PromptBuilder.js"; import { @@ -11,7 +11,7 @@ function promptManipulateSelectionJSONBlocks(opts: { jsonSelectedBlocks: any[]; jsonDocument: any[]; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", @@ -53,7 +53,7 @@ function promptManipulateDocumentUseJSONBlocks(opts: { } >; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", @@ -97,7 +97,7 @@ function promptManipulateDocumentUseJSONBlocks(opts: { ], }), }, - ] satisfies Array) + ] satisfies Array) : []), { role: "system", diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts index 5d76927ec1..71c3a6c29b 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts @@ -1,4 +1,4 @@ -import { CoreMessage } from "ai"; +import { ModelMessage } from "ai"; import { PromptBuilder } from "../PromptBuilder.js"; import { getDataForPromptNoSelection, @@ -14,7 +14,7 @@ function promptManipulateSelectionMarkdownBlocks(opts: { markdownDocument: { block: string; }[]; -}): Array { +}): Array { return [ { role: "system", @@ -58,7 +58,7 @@ function promptManipulateDocumentUseMarkdownBlocks(opts: { cursor: true; } >; -}): Array { +}): Array { return [ { role: "system", diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts index 2cd9e1d018..3f27ae2d36 100644 --- a/packages/xl-ai/src/streamTool/asTool.ts +++ b/packages/xl-ai/src/streamTool/asTool.ts @@ -6,7 +6,7 @@ import { Result, StreamTool, StreamToolCall } from "./streamTool.js"; export function streamToolAsTool>(streamTool: T) { return tool({ - parameters: jsonSchema(streamTool.parameters, { + inputSchema: jsonSchema(streamTool.inputSchema, { validate: (value) => { const result = streamTool.validate(value); if (!result.ok) { @@ -26,7 +26,7 @@ export function streamToolsAsTool[]>(streamTools: T) { const schema = createStreamToolsArraySchema(streamTools); return tool({ - parameters: jsonSchema(schema, { + inputSchema: jsonSchema(schema, { validate: (value) => { const stream = operationsToStream(value); if (!stream.ok) { diff --git a/packages/xl-ai/src/streamTool/jsonSchema.ts b/packages/xl-ai/src/streamTool/jsonSchema.ts index 048af716e7..b55f3a5269 100644 --- a/packages/xl-ai/src/streamTool/jsonSchema.ts +++ b/packages/xl-ai/src/streamTool/jsonSchema.ts @@ -7,7 +7,7 @@ function streamToolToJSONSchema(tool: StreamTool): { $defs?: Record; } { // this adds the tool name as the "type". (not very clean way to do it) - const { properties, required, $defs, ...rest } = tool.parameters; + const { properties, required, $defs, ...rest } = tool.inputSchema; return { schema: { type: "object", diff --git a/packages/xl-ai/src/streamTool/streamTool.ts b/packages/xl-ai/src/streamTool/streamTool.ts index 7257a1adc4..00ddfc184b 100644 --- a/packages/xl-ai/src/streamTool/streamTool.ts +++ b/packages/xl-ai/src/streamTool/streamTool.ts @@ -27,7 +27,7 @@ export type StreamTool = { /** * The schema of the input that the tool expects. The language model will use this to generate the input. */ - parameters: JSONSchema7; + inputSchema: JSONSchema7; /** * Validates the input of the tool call * From a4a914ce3d45da3156c04d738ee81b40f4454258 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 12:41:41 +0200 Subject: [PATCH 13/68] wip --- .../src/streamTool/StreamToolExecutor.ts | 12 +++---- .../clientSideExecutor/clientSideExecutor.ts | 33 +++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index 9da933431f..b1a2496017 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -1,4 +1,4 @@ -import { parsePartialJson } from "@ai-sdk/ui-utils"; +import { parsePartialJson } from "ai"; import { asyncIterableToStream, createAsyncIterableStream, @@ -54,10 +54,10 @@ export class StreamToolExecutor[]> { let lastParsedResult: Operation | undefined; const stream = new TransformStream, Operation>({ - transform: (chunk, controller) => { + transform: async (chunk, controller) => { const operation = typeof chunk === "string" - ? partialJsonToOperation( + ? await partialJsonToOperation( chunk, lastParsedResult?.isPossiblyPartial ?? false, this.streamTools, @@ -147,12 +147,12 @@ export class StreamToolExecutor[]> { } } -function partialJsonToOperation[]>( +async function partialJsonToOperation[]>( chunk: string, isUpdateToPreviousOperation: boolean, streamTools: T, -): Operation | undefined { - const parsed = parsePartialJson(chunk); +): Promise | undefined> { + const parsed = await parsePartialJson(chunk); if (parsed.state === "undefined-input" || parsed.state === "failed-parse") { return undefined; diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts index 5466cce309..2609c9368f 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts @@ -1,12 +1,10 @@ import { - CoreMessage, LanguageModel, - LanguageModelV1, + ModelMessage, generateObject, jsonSchema, streamObject, } from "ai"; - import { ExecuteLLMRequestOptions } from "../../../api/LLMRequest.js"; import { LLMResponse } from "../../../api/LLMResponse.js"; import { createStreamToolsArraySchema } from "../../jsonSchema.js"; @@ -19,7 +17,7 @@ import { type LLMRequestOptions = { model: LanguageModel; - messages: CoreMessage[]; + messages: ModelMessage[]; maxRetries: number; }; @@ -34,7 +32,11 @@ export async function generateOperations[]>( _generateObjectOptions?: Partial>[0]>; }, ) { - const { _generateObjectOptions, ...rest } = opts; + const { _generateObjectOptions, model, ...rest } = opts; + + if (typeof model === "string") { + throw new Error("model must be a LanguageModelV2"); + } if ( _generateObjectOptions && @@ -60,8 +62,8 @@ export async function generateOperations[]>( // TODO: further research this and / or make configurable // for now stick to "tool" by default as this has been tested mostly mode: - rest.model.provider === "mistral.chat" || - rest.model.provider === "google.generative-ai" + model.provider === "mistral.chat" || + model.provider === "google.generative-ai" ? "auto" : "tool", // - mandatory ones: @@ -71,7 +73,7 @@ export async function generateOperations[]>( ...((_generateObjectOptions ?? {}) as any), }; - const ret = await generateObject<{ operations: any }>(options); + const ret = await generateObject(options); const stream = objectToDataStream(ret.object); @@ -103,12 +105,15 @@ export async function streamOperations[]>( streamTools: T, opts: LLMRequestOptions & { _streamObjectOptions?: Partial< - Parameters>[0] + Parameters>[0] >; }, ) { - const { _streamObjectOptions, ...rest } = opts; + const { _streamObjectOptions, model, ...rest } = opts; + if (typeof model === "string") { + throw new Error("model must be a LanguageModelV2"); + } if ( _streamObjectOptions && ("output" in _streamObjectOptions || "schema" in _streamObjectOptions) @@ -130,8 +135,8 @@ export async function streamOperations[]>( // TODO: further research this and / or make configurable // for now stick to "tool" by default as this has been tested mostly mode: - rest.model.provider === "mistral.chat" || - rest.model.provider === "google.generative-ai" + model.provider === "mistral.chat" || + model.provider === "google.generative-ai" ? "auto" : "tool", // - mandatory ones: @@ -141,7 +146,7 @@ export async function streamOperations[]>( ...((opts._streamObjectOptions ?? {}) as any), }; - const ret = streamObject<{ operations: any }>(options); + const ret = streamObject(options); // Transform the partial object stream to a data stream format const stream = partialObjectStreamToDataStream(ret.fullStream); @@ -174,7 +179,7 @@ export function createAISDKLLMRequestExecutor(opts: { * * Note: perhaps we want to remove this */ - model: LanguageModelV1; + model: LanguageModel; /** * Whether to stream the LLM response or not From 1d4adc1b359d30d7cb0f0edec5ce862152a40ec7 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 12:41:51 +0200 Subject: [PATCH 14/68] wip --- docs/content/docs/ai/reference.mdx | 2 +- docs/content/docs/features/ai/reference.mdx | 6 +- .../xl-ai-server/src/routes/vercelAiSdk.ts | 3 +- .../api/formats/json/errorHandling.test.ts | 2 +- .../util/partialObjectStreamUtil.ts | 88 +++---------------- packages/xl-ai/src/testUtil/testAIModels.ts | 7 +- 6 files changed, 22 insertions(+), 86 deletions(-) diff --git a/docs/content/docs/ai/reference.mdx b/docs/content/docs/ai/reference.mdx index 33eae9ed98..68f30daaf1 100644 --- a/docs/content/docs/ai/reference.mdx +++ b/docs/content/docs/ai/reference.mdx @@ -162,7 +162,7 @@ type LLMRequestOptions = { * (when invoking `callLLM` via the `AIExtension` this will default to the * model set in the `AIExtension` options) */ - model: LanguageModelV1; + model: LanguageModel; /** * The user prompt to use for the LLM call */ diff --git a/docs/content/docs/features/ai/reference.mdx b/docs/content/docs/features/ai/reference.mdx index 33eae9ed98..822e7e4614 100644 --- a/docs/content/docs/features/ai/reference.mdx +++ b/docs/content/docs/features/ai/reference.mdx @@ -162,10 +162,8 @@ type LLMRequestOptions = { * (when invoking `callLLM` via the `AIExtension` this will default to the * model set in the `AIExtension` options) */ - model: LanguageModelV1; - /** - * The user prompt to use for the LLM call - */ + model: LanguageModel; + userPrompt: string; /** * Previous response from the LLM, used for multi-step LLM calls diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index e5af965228..ca25d9aba0 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -44,13 +44,12 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { const result = streamText({ model, messages, - toolCallStreaming: true, tools: { // add: tool({}), }, }); - return result.toDataStreamResponse(); + return result.toUIMessageStreamResponse(); }); vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index a47b7e8b0a..f7508950f8 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -17,7 +17,7 @@ const client = createBlockNoteAIClient({ const openai = createOpenAI({ ...client.getProviderSettings("openai"), -})("gpt-4o-2024-08-06", {}); +})("gpt-4o-2024-08-06"); // Separate test suite for error handling with its own server describe("Error handling", () => { diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index 0d53e83645..05ac4c728e 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -1,83 +1,21 @@ import { getErrorMessage } from "@ai-sdk/provider-utils"; import { - formatDataStreamPart, + DeepPartial, isDeepEqualData, + ObjectStreamPart, parsePartialJson, - processDataStream, -} from "@ai-sdk/ui-utils"; -import { DeepPartial, ObjectStreamPart } from "ai"; -import { - AsyncIterableStream, - createAsyncIterableStream, -} from "../../../util/stream.js"; - -// adapted from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 -// change made to throw errors (with the original they're silently ignored) -export function partialObjectStreamThrowError_UNUSED( - stream: ReadableStream>, -): AsyncIterableStream { - return createAsyncIterableStream( - stream.pipeThrough( - new TransformStream, PARTIAL>({ - transform(chunk, controller) { - switch (chunk.type) { - case "object": - controller.enqueue(chunk.object); - break; - - case "text-delta": - case "finish": - break; - case "error": - controller.error(chunk.error); - break; - default: { - const _exhaustiveCheck: never = chunk; - throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); - } - } - }, - }), - ), - ); -} - -// from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1 -export function partialObjectStream_UNUSED( - stream: ReadableStream>, -): AsyncIterableStream { - return createAsyncIterableStream( - stream.pipeThrough( - new TransformStream, PARTIAL>({ - transform(chunk, controller) { - switch (chunk.type) { - case "object": - controller.enqueue(chunk.object); - break; - case "text-delta": - case "finish": - break; - case "error": - break; - default: { - const _exhaustiveCheck: never = chunk; - throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`); - } - } - }, - }), - ), - ); -} + readUIMessageStream, + UIMessageChunk, +} from "ai"; -// based on https://github.com/vercel/ai/blob/d383c37072a91dfd0cebac13893dea044d9f88fa/packages/react/src/use-object.ts#L185 +// based on https://github.com/vercel/ai/blob/d8ada0eb81e42633172d739a40c88e6c5a2f426b/packages/react/src/use-object.ts#L202 export function textStreamToPartialObjectStream() { let accumulatedText = ""; let latestObject: DeepPartial | undefined = undefined; return new TransformStream>({ - transform(chunk, controller) { + transform: async (chunk, controller) => { accumulatedText += chunk; - const { value } = parsePartialJson(accumulatedText); + const { value } = await parsePartialJson(accumulatedText); const currentObject = value as DeepPartial; if (!isDeepEqualData(latestObject, currentObject)) { @@ -89,16 +27,16 @@ export function textStreamToPartialObjectStream() { }); } -export function dataStreamToTextStream(stream: ReadableStream) { +export function dataStreamToTextStream(stream: ReadableStream) { let errored = false; const textStream = new ReadableStream({ start(controller) { - processDataStream({ + readUIMessageStream({ stream, - onTextPart: (chunk) => { + onTextPart: (chunk: any) => { controller.enqueue(chunk); }, - onErrorPart: (chunk) => { + onErrorPart: (chunk: any) => { errored = true; controller.error(chunk); // console.log("error", chunk); @@ -109,7 +47,7 @@ export function dataStreamToTextStream(stream: ReadableStream) { controller.close(); } }, - (error) => { + (error: any) => { controller.error(error); }, ); diff --git a/packages/xl-ai/src/testUtil/testAIModels.ts b/packages/xl-ai/src/testUtil/testAIModels.ts index 314270e4b3..c8c65e8b2b 100644 --- a/packages/xl-ai/src/testUtil/testAIModels.ts +++ b/packages/xl-ai/src/testUtil/testAIModels.ts @@ -2,6 +2,7 @@ import { createAnthropic } from "@ai-sdk/anthropic"; import { createGroq } from "@ai-sdk/groq"; import { createOpenAI } from "@ai-sdk/openai"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; +import { LanguageModel } from "ai"; import { createBlockNoteAIClient } from "../blocknoteAIClient/client.js"; // Create client and models outside of test suites so they can be shared @@ -16,11 +17,11 @@ const groq = createGroq({ const openai = createOpenAI({ ...client.getProviderSettings("openai"), -})("gpt-4o-2024-08-06", {}); +})("gpt-4o-2024-08-06"); const anthropic = createAnthropic({ ...client.getProviderSettings("anthropic"), -})("claude-3-7-sonnet-latest", {}); +})("claude-3-7-sonnet-latest"); const albert = createOpenAICompatible({ name: "albert-etalab", @@ -28,7 +29,7 @@ const albert = createOpenAICompatible({ ...client.getProviderSettings("albert-etalab"), })("albert-etalab.chat/albert-large"); -export const testAIModels = { +export const testAIModels: Record> = { groq, openai, albert, From 9c97b16e90a0f7b955081089316ce1f71f61d163 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 14:15:34 +0200 Subject: [PATCH 15/68] wip --- .../clientSideExecutor/clientSideExecutor.ts | 23 ++-- .../dataStreamResponseToOperationsResult.ts | 8 +- .../util/partialObjectStreamUtil.ts | 111 +++++++++++++----- 3 files changed, 95 insertions(+), 47 deletions(-) diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts index 2609c9368f..2fe8a960e3 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts @@ -1,6 +1,7 @@ import { LanguageModel, ModelMessage, + createUIMessageStreamResponse, generateObject, jsonSchema, streamObject, @@ -11,8 +12,8 @@ import { createStreamToolsArraySchema } from "../../jsonSchema.js"; import { StreamTool } from "../../streamTool.js"; import { dataStreamResponseToOperationsResult } from "../util/dataStreamResponseToOperationsResult.js"; import { - objectToDataStream, - partialObjectStreamToDataStream, + objectToUIMessageStream, + partialObjectStreamToUIMessageStream, } from "../util/partialObjectStreamUtil.js"; type LLMRequestOptions = { @@ -75,7 +76,7 @@ export async function generateOperations[]>( const ret = await generateObject(options); - const stream = objectToDataStream(ret.object); + const stream = objectToUIMessageStream(ret.object); return { dataStreamResponse: new Response( @@ -149,20 +150,12 @@ export async function streamOperations[]>( const ret = streamObject(options); // Transform the partial object stream to a data stream format - const stream = partialObjectStreamToDataStream(ret.fullStream); + const stream = partialObjectStreamToUIMessageStream(ret.fullStream); return { - dataStreamResponse: new Response( - stream.pipeThrough(new TextEncoderStream()), - { - status: 200, - statusText: "OK", - headers: { - contentType: "text/plain; charset=utf-8", - dataStreamVersion: "v1", - }, - }, - ), + uiMessageStreamResponse: createUIMessageStreamResponse({ + stream, + }), /** * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode */ diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts index fa75e30fee..c81b979adb 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts @@ -1,3 +1,4 @@ +import { DefaultChatTransport, readUIMessageStream } from "ai"; import { OperationsResult } from "../../../api/LLMResponse.js"; import { createAsyncIterableStream, @@ -7,7 +8,7 @@ import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations import { preprocessOperationsStreaming } from "../../preprocess.js"; import { StreamTool, StreamToolCall } from "../../streamTool.js"; import { - dataStreamToTextStream, + uiMessageStreamToTextStream, textStreamToPartialObjectStream, } from "./partialObjectStreamUtil.js"; @@ -20,7 +21,10 @@ export async function dataStreamResponseToOperationsResult< // noop }, ): Promise> { - const ret = dataStreamToTextStream(response.body!).pipeThrough( + + const transport = new DefaultChatTransport(); + transport. + const ret = uiMessageStreamToTextStream(response.body!).pipeThrough( textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), ); diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index 05ac4c728e..69deffd5fd 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -8,6 +8,25 @@ import { UIMessageChunk, } from "ai"; +/** + * This file contains some helper functions to convert between object generation (streaming and non-streaming) + * and UI Message streams and vice versa. + * + * Normally, the AI SDK uses a TextStream to transport generated objects / object streams. + * However, this does not work well with error handling (TODO: validate this). + * + * See: + * + * @see https://github.com/vercel/ai/issues/5027#issuecomment-2701011869 + * @see https://github.com/vercel/ai/issues/5115 + * + * Therefor, we convert the object (streams) to the UIMessageStream format that's also used by streamText / generateText + */ + +/** + * FUNCTIONS TO CONVERT FROM UIMESSAGESTREAM TO OBJECT (STREAMS)) + */ + // based on https://github.com/vercel/ai/blob/d8ada0eb81e42633172d739a40c88e6c5a2f426b/packages/react/src/use-object.ts#L202 export function textStreamToPartialObjectStream() { let accumulatedText = ""; @@ -27,35 +46,42 @@ export function textStreamToPartialObjectStream() { }); } -export function dataStreamToTextStream(stream: ReadableStream) { +export function uiMessageStreamToTextStream( + stream: ReadableStream, +) { let errored = false; const textStream = new ReadableStream({ - start(controller) { - readUIMessageStream({ + async start(controller) { + for await (const chunk of readUIMessageStream({ stream, - onTextPart: (chunk: any) => { - controller.enqueue(chunk); - }, - onErrorPart: (chunk: any) => { + onError: (error: any) => { errored = true; - controller.error(chunk); - // console.log("error", chunk); - }, - }).then( - () => { - if (!errored) { - controller.close(); - } - }, - (error: any) => { controller.error(error); }, - ); + terminateOnError: true, + })) { + for (const part of chunk.parts) { + switch (part.type) { + case "text": + // TODO + console.log("text", part.text); + controller.enqueue(part.text); + break; + } + } + } + if (!errored) { + controller.close(); + } }, }); return textStream; } +/** + * FUNCTIONS TO CONVERT FROM OBJECT (STREAMS) TO UIMESSAGESTREAM + */ + /** * Transforms a partial object stream to a data stream format. * This is needed to pass errors through to the client in a clean way. @@ -63,26 +89,36 @@ export function dataStreamToTextStream(stream: ReadableStream) { * @param stream - The partial object stream to transform * @returns A ReadableStream that emits data stream formatted chunks * - * @see https://github.com/vercel/ai/issues/5027#issuecomment-2701011869 - * @see https://github.com/vercel/ai/issues/5115 + * Based on: https://github.com/vercel/ai/blob/b2469681bd31635a33a4b233d889f122c0b432c9/packages/ai/src/ui/transform-text-to-ui-message-stream.ts#L3 + * */ -export function partialObjectStreamToDataStream( +export function partialObjectStreamToUIMessageStream( stream: ReadableStream>, -): ReadableStream { +): ReadableStream { return stream.pipeThrough( new TransformStream({ + start(controller) { + controller.enqueue({ type: "start" }); + controller.enqueue({ type: "start-step" }); + controller.enqueue({ type: "text-start", id: "text-1" }); + }, transform(chunk, controller) { switch (chunk.type) { case "text-delta": - controller.enqueue(formatDataStreamPart("text", chunk.textDelta)); + controller.enqueue({ + type: "text-delta", + id: "text-1", + delta: chunk.textDelta, + }); break; case "object": case "finish": break; case "error": - controller.enqueue( - formatDataStreamPart("error", getErrorMessage(chunk.error)), - ); + controller.enqueue({ + type: "error", + errorText: getErrorMessage(chunk.error), + }); break; default: { const _exhaustiveCheck: never = chunk; @@ -90,15 +126,30 @@ export function partialObjectStreamToDataStream( } } }, + async flush(controller) { + controller.enqueue({ type: "text-end", id: "text-1" }); + controller.enqueue({ type: "finish-step" }); + controller.enqueue({ type: "finish" }); + }, }), ); } -export function objectToDataStream(object: any) { - const stream = new ReadableStream({ +// convert a plain object to a UIMessageStream. +export function objectToUIMessageStream(object: any) { + const stream = new ReadableStream({ start(controller) { - controller.enqueue(formatDataStreamPart("text", JSON.stringify(object))); - controller.close(); + controller.enqueue({ type: "start" }); + controller.enqueue({ type: "start-step" }); + controller.enqueue({ type: "text-start", id: "text-1" }); + controller.enqueue({ + type: "text-delta", + id: "text-1", + delta: JSON.stringify(object), + }); + controller.enqueue({ type: "text-end", id: "text-1" }); + controller.enqueue({ type: "finish-step" }); + controller.enqueue({ type: "finish" }); }, }); return stream; From fafe2043820ec099aaf1cc0f8516600a04574c47 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 2 Sep 2025 22:29:23 +0200 Subject: [PATCH 16/68] basics working on v5 --- examples/09-ai/01-minimal/src/App.tsx | 9 +- examples/09-ai/02-playground/src/App.tsx | 26 +- .../09-ai/03-custom-ai-menu-items/src/App.tsx | 10 +- .../09-ai/04-with-collaboration/src/App.tsx | 10 +- .../09-ai/06-server-execution/src/App.tsx | 34 +-- .../xl-ai-server/src/routes/vercelAiSdk.ts | 27 +- packages/xl-ai-server/tsconfig.json | 6 +- packages/xl-ai/src/api/LLMRequest.ts | 33 ++- packages/xl-ai/src/api/LLMResponse.ts | 4 +- .../xl-ai/src/api/formats/PromptBuilder.ts | 6 +- .../html-blocks/defaultHTMLPromptBuilder.ts | 183 +++++++++--- .../formats/html-blocks/htmlBlocks.test.ts | 11 +- .../formats/json/defaultJSONPromptBuilder.ts | 269 ++++++++++++++---- .../api/formats/json/errorHandling.test.ts | 13 +- .../xl-ai/src/api/formats/json/json.test.ts | 11 +- .../defaultMarkdownPromptBuilder.ts | 245 ++++++++++++++-- .../markdown-blocks/markdownBlocks.test.ts | 12 +- packages/xl-ai/src/index.ts | 4 +- .../vercelAiSdk/AISDKLLMRequestExecutor.ts | 39 +++ .../ClientSideTransport.ts} | 193 +++++++------ ...s => UIMessageStreamToOperationsResult.ts} | 16 +- .../util/partialObjectStreamUtil.ts | 24 +- packages/xl-ai/src/testUtil/testAIModels.ts | 2 +- 23 files changed, 860 insertions(+), 327 deletions(-) create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts rename packages/xl-ai/src/streamTool/vercelAiSdk/{clientSideExecutor/clientSideExecutor.ts => clientside/ClientSideTransport.ts} (59%) rename packages/xl-ai/src/streamTool/vercelAiSdk/util/{dataStreamResponseToOperationsResult.ts => UIMessageStreamToOperationsResult.ts} (80%) diff --git a/examples/09-ai/01-minimal/src/App.tsx b/examples/09-ai/01-minimal/src/App.tsx index 725ee99779..2e5945cd34 100644 --- a/examples/09-ai/01-minimal/src/App.tsx +++ b/examples/09-ai/01-minimal/src/App.tsx @@ -15,7 +15,9 @@ import { import { AIMenuController, AIToolbarButton, + ClientSideTransport, createAIExtension, + createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; @@ -63,8 +65,13 @@ export default function App() { }, // Register the AI extension extensions: [ + // TODO: too many layers of indirection? createAIExtension({ - executor: model as any, // TODO + executor: createAISDKLLMRequestExecutor({ + transport: new ClientSideTransport({ + model, + }), + }), }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index e0621fccf5..137bd38080 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -22,7 +22,9 @@ import { import { AIMenuController, AIToolbarButton, + ClientSideTransport, createAIExtension, + createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAIExtension, getAISlashMenuItems, @@ -42,7 +44,7 @@ import { getEnv } from "./getEnv"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", }); // return the AI SDK model based on the selected model string @@ -52,7 +54,7 @@ function getModel(aiModelString: string) { if (provider === "openai.chat") { return createOpenAI({ ...client.getProviderSettings("openai"), - })(modelName, {}); + })(modelName); } else if (provider === "groq.chat") { return createGroq({ ...client.getProviderSettings("groq"), @@ -74,9 +76,7 @@ function getModel(aiModelString: string) { } else if (provider === "google.generative-ai") { return createGoogleGenerativeAI({ ...client.getProviderSettings("google"), - })(modelName, { - structuredOutputs: false, - }); + })(modelName); } else { return "unknown-model" as const; } @@ -100,8 +100,11 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: model as any, // TODO - // model: model as LanguageModelV1, // (type because initially it's valid) + executor: createAISDKLLMRequestExecutor({ + transport: new ClientSideTransport({ + model, + }), + }), }), ], // We set some initial content for demo purposes @@ -136,7 +139,14 @@ export default function App() { useEffect(() => { // update the default model in the extension if (model !== "unknown-model") { - ai.options.setState({ executor: model as any }); // TODO + ai.options.setState({ + executor: createAISDKLLMRequestExecutor({ + transport: new ClientSideTransport({ + model, + stream: false, + }), + }), + }); } }, [model, ai.options]); diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index b01e25a3ba..4910b70a9f 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -16,7 +16,9 @@ import { AIMenu, AIMenuController, AIToolbarButton, + ClientSideTransport, createAIExtension, + createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, getDefaultAIMenuItems, @@ -32,7 +34,7 @@ import { addRelatedTopics, makeInformal } from "./customAIMenuItems"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", }); // Use an "open" model such as llama, in this case via groq.com @@ -67,7 +69,11 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: model as any, // TODO + executor: createAISDKLLMRequestExecutor({ + transport: new ClientSideTransport({ + model, + }), + }), }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index 081571bba8..6a4d529402 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -15,7 +15,9 @@ import { import { AIMenuController, AIToolbarButton, + ClientSideTransport, createAIExtension, + createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; @@ -60,7 +62,7 @@ const ghostContent = const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", }); // Use an "open" model such as llama, in this case via groq.com @@ -109,7 +111,11 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: model as any, // TODO + executor: createAISDKLLMRequestExecutor({ + transport: new ClientSideTransport({ + model, + }), + }), }), ], // We set some initial content for demo purposes diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx index 6b609aa554..d7ba5cf519 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -15,14 +15,12 @@ import { AIMenuController, AIToolbarButton, createAIExtension, - createStreamToolsArraySchema, - dataStreamResponseToOperationsResult, + createAISDKLLMRequestExecutor, getAISlashMenuItems, - LLMResponse, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; - +import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; const BASE_URL = @@ -42,28 +40,12 @@ export default function App() { // We define a custom executor that calls our backend server to execute LLM calls // On the backend, we use the Vercel AI SDK to execute LLM calls // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) - executor: async (opts) => { - const schema = createStreamToolsArraySchema(opts.streamTools); - - // Can also use /generateObject for non-streaming mode - const response = await fetch(`${BASE_URL}/streamObject`, { - method: "POST", - body: JSON.stringify({ - messages: opts.messages, - schema, - }), - }); - const parsedResponse = await dataStreamResponseToOperationsResult( - response, - opts.streamTools, - opts.onStart, - ); - return new LLMResponse( - opts.messages, - parsedResponse, - opts.streamTools, - ); - }, + executor: createAISDKLLMRequestExecutor({ + transport: new DefaultChatTransport({ + // Can also use /generateObject for non-streaming mode + api: `${BASE_URL}/streamObject`, + }), + }), }), ], // We set some initial content for demo purposes diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index ca25d9aba0..1b56b35884 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -1,9 +1,10 @@ import { createOpenAI } from "@ai-sdk/openai"; import { - objectToDataStream, - partialObjectStreamToDataStream, + objectToUIMessageStream, + partialObjectStreamToUIMessageStream, } from "@blocknote/xl-ai"; import { + createUIMessageStreamResponse, generateObject, generateText, jsonSchema, @@ -62,16 +63,9 @@ vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { schema: jsonSchema(schema), }); - const dataStream = partialObjectStreamToDataStream(result.fullStream); + const stream = partialObjectStreamToUIMessageStream(result.fullStream); - return new Response(dataStream.pipeThrough(new TextEncoderStream()), { - status: 200, - statusText: "OK", - headers: { - contentType: "text/plain; charset=utf-8", - dataStreamVersion: "v1", - }, - }); + return createUIMessageStreamResponse({ stream }); }); vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { @@ -84,14 +78,7 @@ vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { schema: jsonSchema(schema), }); - const dataStream = objectToDataStream(result.object); + const stream = objectToUIMessageStream(result.object); - return new Response(dataStream.pipeThrough(new TextEncoderStream()), { - status: 200, - statusText: "OK", - headers: { - contentType: "text/plain; charset=utf-8", - dataStreamVersion: "v1", - }, - }); + return createUIMessageStreamResponse({ stream }); }); diff --git a/packages/xl-ai-server/tsconfig.json b/packages/xl-ai-server/tsconfig.json index 283e07431f..390c5b0747 100644 --- a/packages/xl-ai-server/tsconfig.json +++ b/packages/xl-ai-server/tsconfig.json @@ -21,5 +21,9 @@ "skipLibCheck": true }, "include": ["src"], - "references": [] + "references": [ + { + "path": "../xl-ai" + } + ] } diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index da260f3b80..c5c05eae9b 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,5 +1,5 @@ import { BlockNoteEditor } from "@blocknote/core"; -import { ModelMessage } from "ai"; +import { UIMessage } from "ai"; import { StreamTool } from "../streamTool/streamTool.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; @@ -11,7 +11,7 @@ import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; type MakeOptional = Omit & Partial>; export type ExecuteLLMRequestOptions = { - messages: ModelMessage[]; + messages: UIMessage[]; streamTools: StreamTool[]; // TODO: needed? llmRequestOptions: MakeOptional; @@ -143,17 +143,24 @@ export async function doLLMRequest( ? editor.getSelectionCutBlocks() : undefined; - let previousMessages: ModelMessage[] | undefined = undefined; + let previousMessages: UIMessage[] | undefined = undefined; if (previousResponse) { previousMessages = previousResponse.messages.map((m) => { // Some models, like Gemini and Anthropic don't support mixing system and user messages. // Therefore, we convert all user messages to system messages. // (also see comment below on a possibly better approach that might also address this) - if (m.role === "user" && typeof m.content === "string") { + if (m.role === "user") { return { + id: m.id, role: "system", - content: `USER_MESSAGE: ${m.content}`, + parts: m.parts.map((part) => { + if (part.type === "text") { + return { type: "text", text: `USER_MESSAGE: ${part.text}` }; + } + + throw new Error(`Unexpected part type: ${part.type}`); + }), }; } @@ -173,12 +180,18 @@ export async function doLLMRequest( */ // TODO: fix // previousMessages.push({ + // id: "previous-response-message", // role: "system", // using "assistant" here doesn't work with gemini because we can't mix system / assistant messages - // content: - // "ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call: \n" + - // JSON.stringify( - // await previousResponse.llmResult.getGeneratedOperations(), - // ), + // parts: [ + // { + // type: "text", + // text: + // "ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call: \n" + + // JSON.stringify( + // await previousResponse.llmResult.getGeneratedOperations(), + // ), + // }, + // ], // }); } diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts index 2c0aaa1567..10ace37cc3 100644 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -1,4 +1,4 @@ -import { ModelMessage } from "ai"; +import { UIMessage } from "ai"; import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; import { StreamToolExecutor } from "../streamTool/StreamToolExecutor.js"; import { AsyncIterableStream } from "../util/stream.js"; @@ -39,7 +39,7 @@ export class LLMResponse { /** * The messages sent to the LLM */ - public readonly messages: ModelMessage[], + public readonly messages: UIMessage[], /** * Result of the underlying LLM call. Use this to access operations the LLM decided to execute, but without applying them. * (usually this is only used for advanced used cases or debugging) diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index 01aa1c4ce0..528a9e0a6b 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -1,5 +1,5 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; -import { ModelMessage } from "ai"; +import { UIMessage } from "ai"; /* We want users to be able to easily customize the prompts send to an LLM, @@ -33,7 +33,7 @@ export type PromptBuilderInput = { * When following a multi-step conversation, or repairing a previous error, * the previous messages that have been sent to the LLM */ - previousMessages?: Array; + previousMessages?: Array; }; /** @@ -43,4 +43,4 @@ export type PromptBuilderInput = { export type PromptBuilder = ( editor: BlockNoteEditor, opts: PromptBuilderInput, -) => Promise>; +) => Promise>; diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index 06dd40146e..46f9f69147 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -1,4 +1,4 @@ -import { ModelMessage } from "ai"; +import { UIMessage } from "ai"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import type { PromptBuilder } from "../PromptBuilder.js"; import { @@ -16,35 +16,64 @@ function promptManipulateSelectionHTMLBlocks(opts: { block: string; }[]; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", - content: `You're manipulating a selected part of a text document using HTML blocks. + id: "html-selected-blocks", + parts: [ + { + type: "text", + text: `You're manipulating a selected part of a text document using HTML blocks. Make sure to follow the json schema provided and always include the trailing $ in ids. List items are 1 block with 1 list item each, so block content \`
  • item1
\` is valid, but \`
  • item1
  • item2
\` is invalid. We'll merge them automatically. This is the selection as an array of html blocks:`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.htmlSelectedBlocks), - }, - { - role: "system", - content: - "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + id: "html-selected-blocks-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.htmlSelectedBlocks), + }, + ], }, { role: "system", - content: JSON.stringify(opts.htmlDocument), + id: "html-document", + parts: [ + { + type: "text", + text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.htmlDocument), + }, + ], }, { role: "system", - content: "The user asks you to do the following:", + id: "html-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "html-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -61,40 +90,70 @@ function promptManipulateDocumentUseHTMLBlocks(opts: { } >; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", - content: `You're manipulating a text document using HTML blocks. + id: "html-document", + parts: [ + { + type: "text", + text: `You're manipulating a text document using HTML blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). List items are 1 block with 1 list item each, so block content \`
  • item1
\` is valid, but \`
  • item1
  • item2
\` is invalid. We'll merge them automatically. For code blocks, you can use the \`data-language\` attribute on a code block to specify the language. This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.htmlBlocks), + id: "html-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.htmlBlocks), + }, + ], }, { role: "system", - content: - `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. + id: "html-user-prompt", + parts: [ + { + type: "text", + text: + `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need \`referenceId\` to point to the block before the cursor with position \`after\` (or block below and \`before\`). ` + - (opts.isEmptyDocument - ? `Because the document is empty, first update the empty block before adding new blocks.` - : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."), + (opts.isEmptyDocument + ? `Because the document is empty, first update the empty block before adding new blocks.` + : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."), + }, + ], }, { role: "system", - content: "The user asks you to do the following:", + id: "html-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "html-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -112,31 +171,67 @@ export const defaultHTMLPromptBuilder: PromptBuilder = async (editor, opts) => { ...opts.previousMessages, { role: "system", - content: `After processing the previous response, this is the updated selection. + id: "html-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated selection. Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], }, { role: "system", - content: JSON.stringify(data.htmlSelectedBlocks), + id: "html-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.htmlSelectedBlocks), + }, + ], }, { role: "system", - content: "This is the updated entire document:", + id: "html-previous-response-document", + parts: [ + { + type: "text", + text: "This is the updated entire document:", + }, + ], }, { role: "system", - content: JSON.stringify(data.htmlDocument), + id: "html-previous-response-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.htmlDocument), + }, + ], }, { role: "system", - content: `You SHOULD use "update" operations to update blocks you added / edited previously + id: "html-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously (unless the user explicitly asks you otherwise to add or delete other blocks). The user now asks you to do the following:`, + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "html-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -153,23 +248,47 @@ export const defaultHTMLPromptBuilder: PromptBuilder = async (editor, opts) => { ...opts.previousMessages, { role: "system", - content: `After processing the previous response, this is the updated document. + id: "html-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated document. Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], }, { role: "system", - content: JSON.stringify(data.htmlBlocks), + id: "html-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.htmlBlocks), + }, + ], }, { role: "system", - content: `You SHOULD use "update" operations to update blocks you added / edited previously + id: "html-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously (unless the user explicitly asks you otherwise to add or delete other blocks). The user now asks you to do the following:`, + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "html-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 236a2fd144..47c4cf0144 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -3,7 +3,8 @@ import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; +import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; @@ -128,9 +129,11 @@ describe("Models", () => { dataFormat: htmlBlockLLMFormat, withDelays: false, executor: createAISDKLLMRequestExecutor({ - model: params.model, - stream: params.stream, - maxRetries: 0, + transport: new ClientSideTransport({ + model: params.model, + maxRetries: 0, + stream: params.stream, + }), }), }), // TODO: remove when matthew's parsing PR is merged diff --git a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts index f1f2493a3b..b0adaecca1 100644 --- a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts @@ -1,6 +1,6 @@ -import { ModelMessage } from "ai"; +import { UIMessage } from "ai"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; -import { PromptBuilder } from "../PromptBuilder.js"; +import type { PromptBuilder } from "../PromptBuilder.js"; import { getDataForPromptNoSelection, getDataForPromptWithSelection, @@ -11,35 +11,63 @@ function promptManipulateSelectionJSONBlocks(opts: { jsonSelectedBlocks: any[]; jsonDocument: any[]; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", - content: `You're manipulating a selected part of a text document using JSON blocks. + id: "json-selected-blocks", + parts: [ + { + type: "text", + text: `You're manipulating a selected part of a text document using HTML blocks. Make sure to follow the json schema provided and always include the trailing $ in ids. This is the selection as an array of JSON blocks:`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.jsonSelectedBlocks), - }, - - { - role: "system", - content: - "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + id: "json-selected-blocks-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.jsonSelectedBlocks), + }, + ], }, { role: "system", - content: JSON.stringify(opts.jsonDocument), + id: "json-document", + parts: [ + { + type: "text", + text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.jsonDocument), + }, + ], }, { role: "system", - content: "The user asks you to do the following:", + id: "json-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "json-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -53,71 +81,68 @@ function promptManipulateDocumentUseJSONBlocks(opts: { } >; isEmptyDocument: boolean; -}): Array { +}): Array { return [ { role: "system", - content: `You're manipulating a text document using JSON blocks. + id: "json-document", + parts: [ + { + type: "text", + text: `You're manipulating a text document using JSON blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). This is the document as an array of JSON blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.jsonBlocks), - }, - ...(opts.isEmptyDocument - ? ([ - { - role: "system", - content: `Because the actual document is empty, this is an example document to understand the schema:`, - }, - { - role: "system", - content: JSON.stringify({ - id: "ref3", - type: "paragraph", - content: [ - { - type: "text", - text: "Hello, world! ", - styles: {}, - }, - { - type: "text", - text: "Bold text. ", - styles: { - bold: true, - }, - }, - { - type: "link", - href: "https://www.w3.org", - content: "Link.", - }, - ], - }), - }, - ] satisfies Array) - : []), - { - role: "system", - content: "The user asks you to do the following:", + id: "json-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.jsonBlocks), + }, + ], }, { role: "system", - content: - `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. + id: "json-user-prompt", + parts: [ + { + type: "text", + text: + `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. - EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need \`referenceId\` to point to the block before the cursor with position \`after\` (or block below and \`before\`). + EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), + then you need \`referenceId\` to point to the block before the cursor with position \`after\` (or block below and \`before\`). ` + - (opts.isEmptyDocument - ? `Because the document is empty, first update the empty block before adding new blocks.` - : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."), + (opts.isEmptyDocument + ? `Because the document is empty, first update the empty block before adding new blocks.` + : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."), + }, + ], + }, + { + role: "system", + id: "json-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "json-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -130,6 +155,76 @@ export const defaultJSONPromptBuilder: PromptBuilder = async (editor, opts) => { selectedBlocks: opts.selectedBlocks, }); + if (opts.previousMessages) { + return [ + ...opts.previousMessages, + { + role: "system", + id: "json-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated selection. + Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], + }, + { + role: "system", + id: "json-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.jsonSelectedBlocks), + }, + ], + }, + { + role: "system", + id: "json-previous-response-document", + parts: [ + { + type: "text", + text: "This is the updated entire document:", + }, + ], + }, + { + role: "system", + id: "json-previous-response-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.jsonDocument), + }, + ], + }, + { + role: "system", + id: "json-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously + (unless the user explicitly asks you otherwise to add or delete other blocks). + + The user now asks you to do the following:`, + }, + ], + }, + { + role: "user", + id: "json-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ]; + } + return promptManipulateSelectionJSONBlocks({ ...data, userPrompt: opts.userPrompt, @@ -137,6 +232,56 @@ export const defaultJSONPromptBuilder: PromptBuilder = async (editor, opts) => { }); } else { const data = await getDataForPromptNoSelection(editor, opts); + if (opts.previousMessages) { + return [ + ...opts.previousMessages, + { + role: "system", + id: "json-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated document. + Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], + }, + { + role: "system", + id: "json-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.jsonBlocks), + }, + ], + }, + { + role: "system", + id: "json-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously + (unless the user explicitly asks you otherwise to add or delete other blocks). + + The user now asks you to do the following:`, + }, + ], + }, + { + role: "user", + id: "json-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ]; + } + return promptManipulateDocumentUseJSONBlocks({ ...data, userPrompt: opts.userPrompt, diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index f7508950f8..df6f7b2b66 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -5,13 +5,14 @@ import { BlockNoteEditor } from "@blocknote/core"; import { HttpResponse, http } from "msw"; import { setupServer } from "msw/node"; import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; +import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { jsonLLMFormat } from "./json.js"; // Create client and models outside of test suites so they can be shared const client = createBlockNoteAIClient({ - baseURL: "https://localhost:3000/ai", + baseURL: "https://localhost:3000/ai/proxy", apiKey: "PLACEHOLDER", }); @@ -76,9 +77,11 @@ describe("Error handling", () => { const result = await doLLMRequest(editor, { userPrompt: "translate to Spanish", executor: createAISDKLLMRequestExecutor({ - model: openai, - maxRetries: 0, - stream, + transport: new ClientSideTransport({ + model: openai, + maxRetries: 0, + stream, + }), }), dataFormat: jsonLLMFormat, }); diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts index b6034264ae..7b92933eec 100644 --- a/packages/xl-ai/src/api/formats/json/json.test.ts +++ b/packages/xl-ai/src/api/formats/json/json.test.ts @@ -6,7 +6,8 @@ import { setupServer } from "msw/node"; import path from "path"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; +import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { jsonLLMFormat } from "./json.js"; @@ -117,9 +118,11 @@ describe.skip("Models", () => { doLLMRequest(editor, { ...options, executor: createAISDKLLMRequestExecutor({ - model: params.model, - maxRetries: 0, - stream: params.stream, + transport: new ClientSideTransport({ + model: params.model, + maxRetries: 0, + stream: params.stream, + }), }), withDelays: false, dataFormat: jsonLLMFormat, diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts index 71c3a6c29b..db69629c0c 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts @@ -1,5 +1,6 @@ -import { ModelMessage } from "ai"; -import { PromptBuilder } from "../PromptBuilder.js"; +import { UIMessage } from "ai"; +import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; +import type { PromptBuilder } from "../PromptBuilder.js"; import { getDataForPromptNoSelection, getDataForPromptWithSelection, @@ -14,35 +15,65 @@ function promptManipulateSelectionMarkdownBlocks(opts: { markdownDocument: { block: string; }[]; -}): Array { + isEmptyDocument: boolean; +}): Array { return [ { role: "system", - content: `You're manipulating a selected part of a text document using markdown blocks. + id: "markdown-selected-blocks", + parts: [ + { + type: "text", + text: `You're manipulating a selected part of a text document using Markdown blocks. Make sure to follow the json schema provided and always include the trailing $ in ids. + This is the selection as an array of markdown blocks:`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.markdownSelectedBlocks), - }, - - { - role: "system", - content: - "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + id: "markdown-selected-blocks-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.markdownSelectedBlocks), + }, + ], }, { role: "system", - content: JSON.stringify(opts.markdownDocument), + id: "markdown-document", + parts: [ + { + type: "text", + text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.markdownDocument), + }, + ], }, { role: "system", - content: "The user asks you to do the following:", + id: "markdown-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { role: "user", - content: opts.userPrompt, + id: "markdown-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -58,33 +89,70 @@ function promptManipulateDocumentUseMarkdownBlocks(opts: { cursor: true; } >; -}): Array { + isEmptyDocument: boolean; +}): Array { return [ { role: "system", - content: `You're manipulating a text document using markdown blocks. + id: "markdown-document", + parts: [ + { + type: "text", + text: `You're manipulating a text document using Markdown blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). + This is the document as an array of markdown blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + }, + ], }, { role: "system", - content: JSON.stringify(opts.markdownBlocks), + id: "markdown-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(opts.markdownBlocks), + }, + ], }, { role: "system", - content: "The user asks you to do the following:", + id: "markdown-user-prompt", + parts: [ + { + type: "text", + text: + `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. + EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. + EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), + then you need \`referenceId\` to point to the block before the cursor with position \`after\` (or block below and \`before\`). + + ` + + (opts.isEmptyDocument + ? `Because the document is empty, first update the empty block before adding new blocks.` + : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."), + }, + ], }, { - role: "user", - content: opts.userPrompt, + role: "system", + id: "markdown-user-prompt", + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + ], }, { - role: "system", - content: `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed. - EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. - EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need \`referenceId\` to point to the block before the cursor with position \`after\` (or block below and \`before\`). - - Prefer updating blocks over adding or removing (but this also depends on the user's question).`, + role: "user", + id: "markdown-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], }, ]; } @@ -93,19 +161,144 @@ export const defaultMarkdownPromptBuilder: PromptBuilder = async ( editor, opts, ) => { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; + if (opts.selectedBlocks) { const data = await getDataForPromptWithSelection(editor, { selectedBlocks: opts.selectedBlocks, }); + + if (opts.previousMessages) { + return [ + ...opts.previousMessages, + { + role: "system", + id: "markdown-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated selection. + Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.markdownSelectedBlocks), + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-document", + parts: [ + { + type: "text", + text: "This is the updated entire document:", + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-document-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.markdownDocument), + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously + (unless the user explicitly asks you otherwise to add or delete other blocks). + + The user now asks you to do the following:`, + }, + ], + }, + { + role: "user", + id: "markdown-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ]; + } + return promptManipulateSelectionMarkdownBlocks({ ...data, userPrompt: opts.userPrompt, + isEmptyDocument, }); } else { const data = await getDataForPromptNoSelection(editor, opts); + if (opts.previousMessages) { + return [ + ...opts.previousMessages, + { + role: "system", + id: "markdown-previous-response", + parts: [ + { + type: "text", + text: `After processing the previous response, this is the updated document. + Ignore previous documents, you MUST issue operations against this latest version of the document:`, + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-json", + parts: [ + { + type: "text", + text: JSON.stringify(data.markdownBlocks), + }, + ], + }, + { + role: "system", + id: "markdown-previous-response-user-prompt", + parts: [ + { + type: "text", + text: `You SHOULD use "update" operations to update blocks you added / edited previously + (unless the user explicitly asks you otherwise to add or delete other blocks). + + The user now asks you to do the following:`, + }, + ], + }, + { + role: "user", + id: "markdown-previous-response-user-prompt", + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ]; + } + return promptManipulateDocumentUseMarkdownBlocks({ ...data, userPrompt: opts.userPrompt, + isEmptyDocument, }); } }; diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts index ddcefc7a80..75a4f79e01 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts @@ -4,7 +4,9 @@ import { getCurrentTest } from "@vitest/runner"; import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.js"; + +import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; +import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; @@ -116,9 +118,11 @@ describe("Models", () => { doLLMRequest(editor, { ...options, executor: createAISDKLLMRequestExecutor({ - model: params.model, - maxRetries: 0, - stream: params.stream, + transport: new ClientSideTransport({ + model: params.model, + maxRetries: 0, + stream: params.stream, + }), }), withDelays: false, dataFormat: markdownBlocksLLMFormat, diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts index 685d059609..856eda8cfb 100644 --- a/packages/xl-ai/src/index.ts +++ b/packages/xl-ai/src/index.ts @@ -17,5 +17,7 @@ export * from "./api/index.js"; // TODO: organize these exports: export * from "./streamTool/jsonSchema.js"; export * from "./streamTool/StreamToolExecutor.js"; -export * from "./streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.js"; +export * from "./streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; +export * from "./streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; export * from "./streamTool/vercelAiSdk/util/partialObjectStreamUtil.js"; +export * from "./streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.js"; diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts new file mode 100644 index 0000000000..2f599d4bf3 --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts @@ -0,0 +1,39 @@ +import { ChatTransport, UIMessage } from "ai"; +import { ExecuteLLMRequestOptions } from "../../api/LLMRequest.js"; +import { LLMResponse } from "../../api/LLMResponse.js"; +import { UIMessageStreamToOperationsResult } from "./util/UIMessageStreamToOperationsResult.js"; + +/** + * Creates a LLMRequestExecutor based on a AI SDK Transport + */ +export function createAISDKLLMRequestExecutor(opts: { + /** + * The transport to use for the LLM call + */ + transport: ChatTransport; +}) { + const { transport } = opts; + return async (opts: ExecuteLLMRequestOptions) => { + const { messages, streamTools, onStart } = opts; + + // TODO: add support for streamText / generateText and tool calls + + const response = await transport.sendMessages({ + messages, + trigger: "submit-message", + chatId: "1", + messageId: "1", + abortSignal: undefined, + metadata: { + streamTools, + }, + }); + + const parsedResponse = await UIMessageStreamToOperationsResult( + response, + streamTools, + onStart, + ); + return new LLMResponse(messages, parsedResponse, streamTools); + }; +} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts similarity index 59% rename from packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts rename to packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 2fe8a960e3..337826204e 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientSideExecutor/clientSideExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -1,16 +1,15 @@ import { + ChatTransport, LanguageModel, - ModelMessage, - createUIMessageStreamResponse, + UIMessage, + UIMessageChunk, + convertToModelMessages, generateObject, jsonSchema, streamObject, } from "ai"; -import { ExecuteLLMRequestOptions } from "../../../api/LLMRequest.js"; -import { LLMResponse } from "../../../api/LLMResponse.js"; import { createStreamToolsArraySchema } from "../../jsonSchema.js"; import { StreamTool } from "../../streamTool.js"; -import { dataStreamResponseToOperationsResult } from "../util/dataStreamResponseToOperationsResult.js"; import { objectToUIMessageStream, partialObjectStreamToUIMessageStream, @@ -18,7 +17,7 @@ import { type LLMRequestOptions = { model: LanguageModel; - messages: ModelMessage[]; + messages: UIMessage[]; maxRetries: number; }; @@ -27,13 +26,13 @@ type LLMRequestOptions = { * * This is the non-streaming version. */ -export async function generateOperations[]>( +async function generateOperations[]>( streamTools: T, opts: LLMRequestOptions & { _generateObjectOptions?: Partial>[0]>; }, ) { - const { _generateObjectOptions, model, ...rest } = opts; + const { _generateObjectOptions, model, messages, ...rest } = opts; if (typeof model === "string") { throw new Error("model must be a LanguageModelV2"); @@ -53,7 +52,7 @@ export async function generateOperations[]>( // non-overridable options for streamObject output: "object" as const, schema, - + model, // configurable options for streamObject // - optional, with defaults @@ -67,29 +66,29 @@ export async function generateOperations[]>( model.provider === "google.generative-ai" ? "auto" : "tool", + messages: convertToModelMessages(messages), + providerOptions: + model.provider === "groq.chat" + ? { + groq: { + structuredOutputs: false, + }, + } + : {}, + // - mandatory ones: ...rest, // extra options for streamObject ...((_generateObjectOptions ?? {}) as any), - }; + } as const; const ret = await generateObject(options); const stream = objectToUIMessageStream(ret.object); return { - dataStreamResponse: new Response( - stream.pipeThrough(new TextEncoderStream()), - { - status: 200, - statusText: "OK", - headers: { - contentType: "text/plain; charset=utf-8", - dataStreamVersion: "v1", - }, - }, - ), + uiMessageStream: stream, /** * Result of the underlying `generateObject` (AI SDK) call, or `undefined` if streaming mode */ @@ -102,7 +101,7 @@ export async function generateOperations[]>( * * This is the streaming version. */ -export async function streamOperations[]>( +async function streamOperations[]>( streamTools: T, opts: LLMRequestOptions & { _streamObjectOptions?: Partial< @@ -110,11 +109,12 @@ export async function streamOperations[]>( >; }, ) { - const { _streamObjectOptions, model, ...rest } = opts; + const { _streamObjectOptions, model, messages, ...rest } = opts; if (typeof model === "string") { throw new Error("model must be a LanguageModelV2"); } + if ( _streamObjectOptions && ("output" in _streamObjectOptions || "schema" in _streamObjectOptions) @@ -128,6 +128,7 @@ export async function streamOperations[]>( // non-overridable options for streamObject output: "object" as const, schema, + model, // configurable options for streamObject // - optional, with defaults @@ -141,11 +142,20 @@ export async function streamOperations[]>( ? "auto" : "tool", // - mandatory ones: + messages: convertToModelMessages(messages), + providerOptions: + model.provider === "groq.chat" + ? { + groq: { + structuredOutputs: false, + }, + } + : {}, ...rest, // extra options for streamObject ...((opts._streamObjectOptions ?? {}) as any), - }; + } as const; const ret = streamObject(options); @@ -153,9 +163,7 @@ export async function streamOperations[]>( const stream = partialObjectStreamToUIMessageStream(ret.fullStream); return { - uiMessageStreamResponse: createUIMessageStreamResponse({ - stream, - }), + uiMessageStream: stream, /** * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode */ @@ -163,81 +171,82 @@ export async function streamOperations[]>( }; } -export function createAISDKLLMRequestExecutor(opts: { - /** - * The language model to use for the LLM call (AI SDK) - * - * (when invoking `callLLM` via the `AIExtension` this will default to the - * model set in the `AIExtension` options) - * - * Note: perhaps we want to remove this - */ - model: LanguageModel; - - /** - * Whether to stream the LLM response or not - * - * When streaming, we use the AI SDK `streamObject` function, - * otherwise, we use the AI SDK `generateObject` function. - * - * @default true - */ - stream?: boolean; - - /** - * The maximum number of retries for the LLM call - * - * @default 2 - */ - maxRetries?: number; - - /** - * Additional options to pass to the AI SDK `generateObject` function - * (only used when `stream` is `false`) - */ - _generateObjectOptions?: Partial>[0]>; - /** - * Additional options to pass to the AI SDK `streamObject` function - * (only used when `stream` is `true`) - */ - _streamObjectOptions?: Partial>[0]>; -}) { - const { - model, - stream, - maxRetries, - _generateObjectOptions, - _streamObjectOptions, - } = opts; - return async (opts: ExecuteLLMRequestOptions) => { - const { messages, streamTools, onStart } = opts; - - // TODO: add support for streamText / generateText and tool calls - +export class ClientSideTransport + implements ChatTransport +{ + constructor( + private readonly opts: { + /** + * The language model to use for the LLM call (AI SDK) + * + * (when invoking `callLLM` via the `AIExtension` this will default to the + * model set in the `AIExtension` options) + * + * Note: perhaps we want to remove this + */ + model: LanguageModel; + + /** + * Whether to stream the LLM response or not + * + * When streaming, we use the AI SDK `streamObject` function, + * otherwise, we use the AI SDK `generateObject` function. + * + * @default true + */ + stream?: boolean; + + /** + * The maximum number of retries for the LLM call + * + * @default 2 + */ + maxRetries?: number; + + /** + * Additional options to pass to the AI SDK `generateObject` function + * (only used when `stream` is `false`) + */ + _generateObjectOptions?: Partial< + Parameters>[0] + >; + /** + * Additional options to pass to the AI SDK `streamObject` function + * (only used when `stream` is `true`) + */ + _streamObjectOptions?: Partial>[0]>; + }, + ) {} + + async sendMessages({ + messages, + metadata, + }: Parameters["sendMessages"]>[0]): Promise< + ReadableStream + > { + const { streamTools } = metadata as { streamTools: StreamTool[] }; let response: // | Awaited>> Awaited>>; - if (stream) { + if (this.opts.stream) { response = await streamOperations(streamTools, { messages, - model, - maxRetries, - ...(_streamObjectOptions as any), + model: this.opts.model, + maxRetries: this.opts.maxRetries, + ...(this.opts._streamObjectOptions as any), }); } else { response = (await generateOperations(streamTools, { messages, - model, - maxRetries, - ...(_generateObjectOptions as any), + model: this.opts.model, + maxRetries: this.opts.maxRetries, + ...(this.opts._generateObjectOptions as any), })) as any; } + return response.uiMessageStream; + } - const parsedResponse = await dataStreamResponseToOperationsResult( - response.dataStreamResponse, - streamTools, - onStart, - ); - return new LLMResponse(messages, parsedResponse, streamTools); - }; + reconnectToStream(): Promise | null> { + throw new Error("Not implemented"); + } } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts similarity index 80% rename from packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts rename to packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts index c81b979adb..4412548075 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/dataStreamResponseToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -1,4 +1,4 @@ -import { DefaultChatTransport, readUIMessageStream } from "ai"; +import { UIMessageChunk } from "ai"; import { OperationsResult } from "../../../api/LLMResponse.js"; import { createAsyncIterableStream, @@ -8,23 +8,23 @@ import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations import { preprocessOperationsStreaming } from "../../preprocess.js"; import { StreamTool, StreamToolCall } from "../../streamTool.js"; import { - uiMessageStreamToTextStream, textStreamToPartialObjectStream, + uiMessageStreamObjectDataToTextStream, } from "./partialObjectStreamUtil.js"; -export async function dataStreamResponseToOperationsResult< +// stream vs generate, responsibility of backend +// text vs object, + +export async function UIMessageStreamToOperationsResult< T extends StreamTool[], >( - response: Response, + stream: ReadableStream, streamTools: T, onStart: () => void = () => { // noop }, ): Promise> { - - const transport = new DefaultChatTransport(); - transport. - const ret = uiMessageStreamToTextStream(response.body!).pipeThrough( + const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), ); diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index 69deffd5fd..a62b56eff3 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -46,7 +46,7 @@ export function textStreamToPartialObjectStream() { }); } -export function uiMessageStreamToTextStream( +export function uiMessageStreamObjectDataToTextStream( stream: ReadableStream, ) { let errored = false; @@ -62,10 +62,8 @@ export function uiMessageStreamToTextStream( })) { for (const part of chunk.parts) { switch (part.type) { - case "text": - // TODO - console.log("text", part.text); - controller.enqueue(part.text); + case "data-object-delta": + controller.enqueue(part.data); break; } } @@ -100,15 +98,15 @@ export function partialObjectStreamToUIMessageStream( start(controller) { controller.enqueue({ type: "start" }); controller.enqueue({ type: "start-step" }); - controller.enqueue({ type: "text-start", id: "text-1" }); + // controller.enqueue({ type: "text-start", id: "text-1" }); }, transform(chunk, controller) { switch (chunk.type) { case "text-delta": controller.enqueue({ - type: "text-delta", + type: "data-object-delta", id: "text-1", - delta: chunk.textDelta, + data: chunk.textDelta, }); break; case "object": @@ -127,7 +125,7 @@ export function partialObjectStreamToUIMessageStream( } }, async flush(controller) { - controller.enqueue({ type: "text-end", id: "text-1" }); + // controller.enqueue({ type: "text-end", id: "text-1" }); controller.enqueue({ type: "finish-step" }); controller.enqueue({ type: "finish" }); }, @@ -141,13 +139,13 @@ export function objectToUIMessageStream(object: any) { start(controller) { controller.enqueue({ type: "start" }); controller.enqueue({ type: "start-step" }); - controller.enqueue({ type: "text-start", id: "text-1" }); + // controller.enqueue({ type: "data-object-start", id: "text-1" }); controller.enqueue({ - type: "text-delta", + type: "data-object-delta", id: "text-1", - delta: JSON.stringify(object), + data: JSON.stringify(object), }); - controller.enqueue({ type: "text-end", id: "text-1" }); + // controller.enqueue({ type: "text-end", id: "text-1" }); controller.enqueue({ type: "finish-step" }); controller.enqueue({ type: "finish" }); }, diff --git a/packages/xl-ai/src/testUtil/testAIModels.ts b/packages/xl-ai/src/testUtil/testAIModels.ts index c8c65e8b2b..0f4a241157 100644 --- a/packages/xl-ai/src/testUtil/testAIModels.ts +++ b/packages/xl-ai/src/testUtil/testAIModels.ts @@ -7,7 +7,7 @@ import { createBlockNoteAIClient } from "../blocknoteAIClient/client.js"; // Create client and models outside of test suites so they can be shared const client = createBlockNoteAIClient({ - baseURL: "https://localhost:3000/ai", + baseURL: "https://localhost:3000/ai/proxy", apiKey: "PLACEHOLDER", }); From 272a41ceeedb533f1e7e0f032e40d6259a79e94a Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 9 Sep 2025 09:46:34 +0200 Subject: [PATCH 17/68] update tests --- ...lock_1_2f82a8f66db1e848b6fcf11cf3b40597.json | 15 --------------- ...lock_1_978f96ab79514117598ce615ed0d216e.json | 15 +++++++++++++++ ...end)_1_b943c8d1d4a88199049f2cbe696fbfbe.json | 15 +++++++++++++++ ...end)_1_c2d9df5eea16a2823b16315808698634.json | 15 --------------- ...doc)_1_40aff463bb8a67bd634e8126aa4a5b3c.json | 15 +++++++++++++++ ...doc)_1_4a415aef98742a73f1d8e76b31b48fd9.json | 15 --------------- ...end)_1_1088e131f22a66ff3f481d486cddea93.json | 15 +++++++++++++++ ...end)_1_c3ac403267365e72e1acdeaf703272ac.json | 15 --------------- ...art)_1_a7deaebd8a05b0eacd438ef4772a84b0.json | 15 --------------- ...art)_1_e221f5a23fd9e5f358291ebfa4df3f17.json | 15 +++++++++++++++ ...lock_1_c9d02980acbb81e12922c758580ae086.json | 15 --------------- ...end)_1_898ab571e824bb2cf7bfd3a4ec769cc4.json | 15 --------------- ...doc)_1_13f4377aac43e7a42d2e0fbe377b093f.json | 15 --------------- ...end)_1_41b6ad49c80f708e02a289f0a978d10f.json | 15 --------------- ...art)_1_ba9d1b82c2e1653cbfad19e72d157d19.json | 15 --------------- ...lock_1_d7a1ca07ded19de08a51f21236c2d68e.json | 15 --------------- ...end)_1_ea8fe6c45678a567e7bfc9a4f9ff9d7e.json | 15 --------------- ...doc)_1_be406ee8435789d49b4de3a2952366bc.json | 15 --------------- ...end)_1_0f618344844192bfd9fca2e00cb8ef3a.json | 15 --------------- ...art)_1_a171c162d38c9ae40b2a22be3ef913b9.json | 15 --------------- ...lock_1_4490bc6c485a737b4584207976c00303.json | 15 --------------- ...end)_1_7a96610c4bbc6c8f141e4addbc2106bf.json | 15 --------------- ...doc)_1_44de7bf7410dad3111bbadfa384b3806.json | 15 --------------- ...end)_1_b6706fca4145b801d7884d53dd16458f.json | 15 --------------- ...art)_1_f2e4502c4c5fb89e3ab56801c4e2ebb1.json | 15 --------------- ...lock_1_bde67ab7834e0e85453474bfec5d6899.json | 15 --------------- ...end)_1_87f55153eeb60ab71bfc14cc2fd2f957.json | 15 --------------- ...doc)_1_51ba760ef2fb18f3445641c82a09fabc.json | 15 --------------- ...end)_1_8e7994f92b21645243d6012cbefb10aa.json | 15 --------------- ...art)_1_13e966493243f338888f862532e11055.json | 15 --------------- ...lock_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json | 15 +++++++++++++++ ...end)_1_89dd734a48e5bb6a0ab581f12545c16c.json | 15 +++++++++++++++ ...doc)_1_5cac750202d6046abd8166098112fed4.json | 15 +++++++++++++++ ...end)_1_15d07556d6eeaf1468d50c545daa64c1.json | 15 +++++++++++++++ ...art)_1_b3d93e35bb904c82cbfef740afc160b6.json | 15 +++++++++++++++ ...lock_1_1362a8882a7ce918bda9111ad233123e.json | 15 +++++++++++++++ ...end)_1_22cee362389152a9f2eecb273184da49.json | 15 +++++++++++++++ ...doc)_1_e907c7a07830a0dbd5739c6647074a6b.json | 15 +++++++++++++++ ...end)_1_833fa6583ec54362359eb3ad3bb7bee9.json | 15 +++++++++++++++ ...art)_1_8e90c887a5e6d318a269ccd8526978e7.json | 15 +++++++++++++++ ...raph_1_a6c32f94ed9ef180b605d3e529b66f0a.json | 15 --------------- ...raph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json | 15 +++++++++++++++ ...tion_1_33755207ae3d7cb4fcdc044d1ec10ce0.json | 15 +++++++++++++++ ...tion_1_da1b9a436aabf66b488fd5f147c006d6.json | 15 --------------- ...raph_1_b747e1a9db81d87169dbb057c80a400e.json | 15 --------------- ...tion_1_1441637b8dce16dc9c48df2cf6507d9b.json | 15 --------------- ...raph_1_7252c232ad6e528961ee8cb6825e1ced.json | 15 --------------- ...tion_1_ce0574730306ae367b09cefba52e1ee5.json | 15 --------------- ...raph_1_304d3249edb4213cd5b98862492557f2.json | 15 --------------- ...tion_1_58bb195c54dff663752ffdd8e6b50bf0.json | 15 --------------- ...raph_1_f7403010a908af399a5228468b304f47.json | 15 --------------- ...tion_1_495ea67d9ad44b58172da3db145b3a10.json | 15 --------------- ...raph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json | 15 +++++++++++++++ ...tion_1_d94f274cff2542fe1b248e007753da77.json | 15 +++++++++++++++ ...raph_1_0c06e1f34af80242cc3dc017cb7b77f7.json | 15 +++++++++++++++ ...tion_1_6a59628efbb4af73805eb2359a908f14.json | 15 +++++++++++++++ ...lock_1_046ddae2286f36597c05b53211d9b18f.json | 15 +++++++++++++++ ...lock_1_278e7fb63bd96fb65d7e2b2a6c215e24.json | 15 --------------- ...lock_1_b8070bd231a475d9df5bbb9da081cf01.json | 15 --------------- ...lock_1_5190aca5ac8dc8a51ad5b5ab8277fc21.json | 15 --------------- ...lock_1_9b505e5406bea6b6aa0194536538eed7.json | 15 --------------- ...lock_1_4fd26859e74455f20838c0acf2b72429.json | 15 --------------- ...lock_1_8d2db5980d3b724a694a7b9ddba8d6c8.json | 15 +++++++++++++++ ...lock_1_841f6c175f84f924ec16a526ad71e33d.json | 15 +++++++++++++++ ...mark_1_8978afc5c34284715a8914c2fd570f93.json | 15 --------------- ...mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json | 15 +++++++++++++++ ...link_1_36ab57c33a9b92cce12bd3cc2338abca.json | 15 +++++++++++++++ ...link_1_938010771c761a751ffbec3118e90f37.json | 15 --------------- ...tent_1_671661bffc93e10ce475a7a35f15d754.json | 15 --------------- ...tent_1_880bc2c79fd0a55606bc3d4350f3f61b.json | 15 +++++++++++++++ ...tent_1_349b95a48f92584763e38280366e849d.json | 15 +++++++++++++++ ...tent_1_3be350bb2a881627e6d2c9bf1c977133.json | 15 --------------- ...tion_1_8db7582d172169c8d97fa66df3e6f95c.json | 15 +++++++++++++++ ...tion_1_fbbe189dec37c71e5cfc78fa72504cd6.json | 15 --------------- ...date_1_5385a2da1c45e1622a45a76f939b6add.json | 15 +++++++++++++++ ...date_1_fa30387ecfa9d5ca59f612c7ab97f4bd.json | 15 --------------- ...mark_1_55d746e02a3178b820afabb3af591f99.json | 15 +++++++++++++++ ...mark_1_db38bde293870f2bef2303384e4e0a55.json | 15 --------------- ...tion_1_2b37d06351765e430fa35e5ca5c63dec.json | 15 --------------- ...tion_1_e73d0ee5659f2b999842cf3cde2a080f.json | 15 +++++++++++++++ ...tent_1_291012f0f84823dcb3048ae5c5a0a5ac.json | 15 +++++++++++++++ ...tent_1_7a40338400651cdf9b96bdf8da120da9.json | 15 --------------- ...prop_1_2d883e86ea71cfb987a22379a3edfa77.json | 15 --------------- ...prop_1_64a1abcbf8b188a770f1148623bc68d4.json | 15 +++++++++++++++ ...text_1_3ccdc93a62d16ec0bcf50be253c1dc56.json | 15 --------------- ...text_1_7d353e20ad801e6e45d345e96068902e.json | 15 +++++++++++++++ ...aph)_1_65069ec605ef6a1bd8d2aea501d9478f.json | 15 +++++++++++++++ ...aph)_1_809e0216515551c13573267a351ba535.json | 15 --------------- ...ord)_1_12dba322e1c862453710164ab8dacd01.json | 15 --------------- ...ord)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json | 15 +++++++++++++++ ...tion_1_b45440e84c9d81d6dead47bd37f8c771.json | 15 +++++++++++++++ ...tion_1_e8c60e9f841b4ab0a3e3542f57873ecf.json | 15 --------------- ...list_1_0301237447d5b4413e7dadcad3480eb7.json | 15 --------------- ...list_1_71a8ef900853abac07443ce40a054680.json | 15 +++++++++++++++ ...tent_1_4e119094b2f0d01391ba2b29c1b0e3eb.json | 15 +++++++++++++++ ...tent_1_9206839a16fcfab9cdcdd9e45f09f1da.json | 15 --------------- ...type_1_16071edfe34f45ccfeb3bb4b023da531.json | 15 --------------- ...type_1_450063cb74b46323a73d507c480d2b08.json | 15 +++++++++++++++ ...mark_1_fe18c50fd2feadd6457384d8fb8944ec.json | 15 --------------- ...link_1_221aeca7fef5f125b53481e1b86ef472.json | 15 --------------- ...tent_1_556624e3ee02680707ba62c186d62e84.json | 15 --------------- ...tent_1_c0bdc581c11c643bf23b9b9db2d63c81.json | 15 --------------- ...tion_1_0864d889b31cae8e316f6a78ef61df7d.json | 15 --------------- ...date_1_f80b18afddb894d5ef20c2e5b40d1735.json | 15 --------------- ...mark_1_de6fb747b4d41b8d888fabe55320091c.json | 15 --------------- ...tion_1_c0ff836d1dce7a2f6e6f86f220640315.json | 15 --------------- ...tent_1_da5f1ab6fa91c869e64322937264846f.json | 15 --------------- ...prop_1_38b3b843f1c225ba4b5fae0ea9fe7d69.json | 15 --------------- ...text_1_b5b0d849bf7cfd45920a42b802840eb0.json | 15 --------------- ...aph)_1_15b8c82decbf30a714f2df977d22c034.json | 15 --------------- ...ord)_1_7b3ed3b4d44c3e948694f0ea709b6a18.json | 15 --------------- ...tion_1_b44a83174a714b0c75c0ae03566175c0.json | 15 --------------- ...list_1_0d58195328e2194c6d2466a4ff9f8bc5.json | 15 --------------- ...tent_1_25e6f872caa48f5825f7ceb4b0f78655.json | 15 --------------- ...type_1_1199a83747eb0f064e1c6badaa3e788d.json | 15 --------------- ...mark_1_5936286917db7874ab151e025d44f0ec.json | 15 --------------- ...link_1_4aa07cf0823d35359854ab671dd8403a.json | 15 --------------- ...tent_1_f2b4ede7c5fa7fe6f53f0224d9c843e6.json | 15 --------------- ...tent_1_37be7ebe33cd5e612c15b138aa8e868a.json | 15 --------------- ...tion_1_3ab6cac43fb1418a242820f5fb741a80.json | 15 --------------- ...date_1_45a526f03ac0adef7c3c45cb4cda6d5a.json | 15 --------------- ...mark_1_466a1bc182d81c967fcd9dc2d0161046.json | 15 --------------- ...tion_1_2b98509c91ffaa3f4b775afdebef2dd1.json | 15 --------------- ...tent_1_24ba9ad6b82850e51f9aeb27631974c1.json | 15 --------------- ...prop_1_64f592e51960d717cdbd7aa155ae6196.json | 15 --------------- ...text_1_9ae98cae168d1714dcdd12abbf4ab7dc.json | 15 --------------- ...aph)_1_42509ec379b9798b007c4481b1b65118.json | 15 --------------- ...ord)_1_4054e8af99647ab39ef82cbd2fa546c9.json | 15 --------------- ...tion_1_e16698998bf1a04cb9538d79a1ceff2c.json | 15 --------------- ...list_1_12667c1a7b080c02776120c0a85b9cd9.json | 15 --------------- ...tent_1_4f67ef168fbf2021f1b78fb11b22f568.json | 15 --------------- ...type_1_f14e429b4f85b7586942a94000a44f21.json | 15 --------------- ...mark_1_c9e281ea445a93fbc84005fa8a92d07e.json | 15 --------------- ...link_1_6f06b0c532060f9a0c1c0b2f64f2b6ab.json | 15 --------------- ...tent_1_f87724ae16fe199bd8fb1ac207a3ab99.json | 15 --------------- ...tent_1_85ee68d4daa7ddab518c19afcd02cb44.json | 15 --------------- ...tion_1_babb54324affa4adb9249cdae14cf222.json | 15 --------------- ...date_1_8c6a9aa2df797ab1a789805eb44c20c6.json | 15 --------------- ...mark_1_3308e5066e651a6abeb10e26cd62b8c2.json | 15 --------------- ...tion_1_5b43e33507a6bc64943c2383991ad7d4.json | 15 --------------- ...tent_1_b9c728e7fe649e31114138d69a0b69c7.json | 15 --------------- ...prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json | 15 --------------- ...text_1_39a7f24d933099914037252cc9e02645.json | 15 --------------- ...aph)_1_cecd6722d457eb6bb4b1231e28c61b64.json | 15 --------------- ...ord)_1_ca614a9ed0162e6f24732e67e6076cb1.json | 15 --------------- ...tion_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json | 15 --------------- ...list_1_c329ee96e44a6acec8c490bfe9036c3c.json | 15 --------------- ...tent_1_99c94387729dc443ea9a142027ae75a1.json | 15 --------------- ...type_1_9d69f7aa4a1a514ddb293bfae46db69d.json | 15 --------------- ...mark_1_99fc53184b728115e2c9bf977d44addb.json | 15 --------------- ...link_1_ec6e45525b18ba57e7669697631ed856.json | 15 --------------- ...tent_1_69e8bfa87ec2c7377f0f3e5bec154a35.json | 15 --------------- ...tent_1_4fa129b1c39dce035ef12c29e733d88f.json | 15 --------------- ...tion_1_110023b0bf33e516b42bee6f23b6a840.json | 15 --------------- ...date_1_3ea83b592a9e001f52872db06794772f.json | 15 --------------- ...mark_1_6cf3d04771c2ac3bb39f84bda06a167a.json | 15 --------------- ...tion_1_b5e611d650819fc89af1f9ccfb59f24e.json | 15 --------------- ...tent_1_016a76a8b508815af96b7185d6137346.json | 15 --------------- ...prop_1_a6321b1baeca3f0e777cc6f735d39599.json | 15 --------------- ...text_1_cd61b04f5a5a80de556e7524ab8efa7e.json | 15 --------------- ...aph)_1_dca280088154bf070ef536e89a0570c3.json | 15 --------------- ...ord)_1_2419100d41a8a73ec4a564889d7a57e9.json | 15 --------------- ...tion_1_290252f83e798ac47770abfbb9bf6d73.json | 15 --------------- ...list_1_8103f7c569fd8326b0ae947eefd7d92d.json | 15 --------------- ...tent_1_282445e6005328e75fc2768da3503c3b.json | 15 --------------- ...type_1_f1fcbe3b4b5404a79557569199effbf2.json | 15 --------------- ...mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json | 15 +++++++++++++++ ...link_1_3c75ece673f586d1fb428c4250e9726b.json | 15 +++++++++++++++ ...tent_1_e101f067bae31019754a533d650420f9.json | 15 +++++++++++++++ ...tent_1_d41aa8c58e29f2759791b16e2bacd02d.json | 15 +++++++++++++++ ...tion_1_c126a42e416d569f6a46d8d62a7c83c5.json | 15 +++++++++++++++ ...date_1_59cc07c257b80b03c8982433551e5fda.json | 15 +++++++++++++++ ...mark_1_e584b7787ed790b5453cf3c5410f5e3b.json | 15 +++++++++++++++ ...tion_1_bf143f40a5064e08f776cb104a132cd5.json | 15 +++++++++++++++ ...tent_1_f8ff406bd3b389d1c2a77bb991a80206.json | 15 +++++++++++++++ ...prop_1_783882c6aae6d65c404ce0a7d41275ef.json | 15 +++++++++++++++ ...text_1_71a7599d18815777e331d4a9db56d39d.json | 15 +++++++++++++++ ...aph)_1_83e8c09f45e23e2dce4865ab7687a636.json | 15 +++++++++++++++ ...ord)_1_d72e1057215df948279c33e394e182d1.json | 15 +++++++++++++++ ...tion_1_601e089579d3047dcb2dc62e943d20e9.json | 15 +++++++++++++++ ...list_1_83697ff9e8b68ed3b717427d1f615fe7.json | 15 +++++++++++++++ ...tent_1_8677e4e9a17acfed4aef83379790b198.json | 15 +++++++++++++++ ...type_1_d2ed2696edc4763285392fcd631ad144.json | 15 +++++++++++++++ ...mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json | 15 +++++++++++++++ ...link_1_59fabaea832d26ec8ec8f081c7a529a4.json | 15 +++++++++++++++ ...tent_1_2fcde5df596501a21514fd6c781016ae.json | 15 +++++++++++++++ ...tent_1_a44f5f3213caeacb4097fa2f999d8dbc.json | 15 +++++++++++++++ ...tion_1_04b206e81d5fa5883392048171a9dbf0.json | 15 +++++++++++++++ ...date_1_0185e23dcac3614328581a4bdc8c5412.json | 15 +++++++++++++++ ...mark_1_7db10c7b76b46c21e20df5ec249c6f11.json | 15 +++++++++++++++ ...tion_1_63050bff5088b8d04fbcd651e05ae882.json | 15 +++++++++++++++ ...tent_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json | 15 +++++++++++++++ ...prop_1_b2492cfb8ed8d2763405374a07be39ac.json | 15 +++++++++++++++ ...text_1_e53435bc11f15a90456f69fb7826125c.json | 15 +++++++++++++++ ...aph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json | 15 +++++++++++++++ ...ord)_1_209aa14d6a0de75ac1558f50749be796.json | 15 +++++++++++++++ ...tion_1_a59a9b5891c5d484937aae60bb84ea07.json | 15 +++++++++++++++ ...list_1_3caac015b33d4eeda58bd0af3a6a03da.json | 15 +++++++++++++++ ...tent_1_374c98f6cf65c81138b95a534caa4be6.json | 15 +++++++++++++++ ...type_1_9197856e6f82ebff9a1846cbfc765a7b.json | 15 +++++++++++++++ .../api/formats/html-blocks/htmlBlocks.test.ts | 17 +++++++++-------- .../clientside/ClientSideTransport.ts | 1 - .../vercelAiSdk/util/partialObjectStreamUtil.ts | 1 + 203 files changed, 1135 insertions(+), 1884 deletions(-) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_978f96ab79514117598ce615ed0d216e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_b943c8d1d4a88199049f2cbe696fbfbe.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_c2d9df5eea16a2823b16315808698634.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_40aff463bb8a67bd634e8126aa4a5b3c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_4a415aef98742a73f1d8e76b31b48fd9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_1088e131f22a66ff3f481d486cddea93.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c3ac403267365e72e1acdeaf703272ac.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_a7deaebd8a05b0eacd438ef4772a84b0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_e221f5a23fd9e5f358291ebfa4df3f17.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_c9d02980acbb81e12922c758580ae086.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a list (end)_1_898ab571e824bb2cf7bfd3a4ec769cc4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (empty doc)_1_13f4377aac43e7a42d2e0fbe377b093f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_41b6ad49c80f708e02a289f0a978d10f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (start)_1_ba9d1b82c2e1653cbfad19e72d157d19.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_d7a1ca07ded19de08a51f21236c2d68e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_ea8fe6c45678a567e7bfc9a4f9ff9d7e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_be406ee8435789d49b4de3a2952366bc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_0f618344844192bfd9fca2e00cb8ef3a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a171c162d38c9ae40b2a22be3ef913b9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4490bc6c485a737b4584207976c00303.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_7a96610c4bbc6c8f141e4addbc2106bf.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_44de7bf7410dad3111bbadfa384b3806.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_b6706fca4145b801d7884d53dd16458f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_f2e4502c4c5fb89e3ab56801c4e2ebb1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_bde67ab7834e0e85453474bfec5d6899.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_87f55153eeb60ab71bfc14cc2fd2f957.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_51ba760ef2fb18f3445641c82a09fabc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8e7994f92b21645243d6012cbefb10aa.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_13e966493243f338888f862532e11055.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_33755207ae3d7cb4fcdc044d1ec10ce0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_da1b9a436aabf66b488fd5f147c006d6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_b747e1a9db81d87169dbb057c80a400e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_1441637b8dce16dc9c48df2cf6507d9b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_7252c232ad6e528961ee8cb6825e1ced.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ce0574730306ae367b09cefba52e1ee5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_304d3249edb4213cd5b98862492557f2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_58bb195c54dff663752ffdd8e6b50bf0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_f7403010a908af399a5228468b304f47.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_495ea67d9ad44b58172da3db145b3a10.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json create mode 100644 packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_278e7fb63bd96fb65d7e2b2a6c215e24.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_b8070bd231a475d9df5bbb9da081cf01.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_5190aca5ac8dc8a51ad5b5ab8277fc21.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_9b505e5406bea6b6aa0194536538eed7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_4fd26859e74455f20838c0acf2b72429.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_8d2db5980d3b724a694a7b9ddba8d6c8.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_36ab57c33a9b92cce12bd3cc2338abca.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_938010771c761a751ffbec3118e90f37.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_671661bffc93e10ce475a7a35f15d754.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_880bc2c79fd0a55606bc3d4350f3f61b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_349b95a48f92584763e38280366e849d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_3be350bb2a881627e6d2c9bf1c977133.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_8db7582d172169c8d97fa66df3e6f95c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_fbbe189dec37c71e5cfc78fa72504cd6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_5385a2da1c45e1622a45a76f939b6add.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_fa30387ecfa9d5ca59f612c7ab97f4bd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_55d746e02a3178b820afabb3af591f99.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_db38bde293870f2bef2303384e4e0a55.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_2b37d06351765e430fa35e5ca5c63dec.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_e73d0ee5659f2b999842cf3cde2a080f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_291012f0f84823dcb3048ae5c5a0a5ac.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_7a40338400651cdf9b96bdf8da120da9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_2d883e86ea71cfb987a22379a3edfa77.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_64a1abcbf8b188a770f1148623bc68d4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_3ccdc93a62d16ec0bcf50be253c1dc56.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_7d353e20ad801e6e45d345e96068902e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_65069ec605ef6a1bd8d2aea501d9478f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_809e0216515551c13573267a351ba535.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_12dba322e1c862453710164ab8dacd01.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_b45440e84c9d81d6dead47bd37f8c771.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_e8c60e9f841b4ab0a3e3542f57873ecf.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_0301237447d5b4413e7dadcad3480eb7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_4e119094b2f0d01391ba2b29c1b0e3eb.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_9206839a16fcfab9cdcdd9e45f09f1da.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_16071edfe34f45ccfeb3bb4b023da531.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_450063cb74b46323a73d507c480d2b08.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_fe18c50fd2feadd6457384d8fb8944ec.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_221aeca7fef5f125b53481e1b86ef472.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_556624e3ee02680707ba62c186d62e84.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_c0bdc581c11c643bf23b9b9db2d63c81.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_0864d889b31cae8e316f6a78ef61df7d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_f80b18afddb894d5ef20c2e5b40d1735.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_de6fb747b4d41b8d888fabe55320091c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_c0ff836d1dce7a2f6e6f86f220640315.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_da5f1ab6fa91c869e64322937264846f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_38b3b843f1c225ba4b5fae0ea9fe7d69.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_b5b0d849bf7cfd45920a42b802840eb0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_15b8c82decbf30a714f2df977d22c034.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_7b3ed3b4d44c3e948694f0ea709b6a18.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_b44a83174a714b0c75c0ae03566175c0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_0d58195328e2194c6d2466a4ff9f8bc5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_25e6f872caa48f5825f7ceb4b0f78655.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_1199a83747eb0f064e1c6badaa3e788d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_5936286917db7874ab151e025d44f0ec.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_4aa07cf0823d35359854ab671dd8403a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_f2b4ede7c5fa7fe6f53f0224d9c843e6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_37be7ebe33cd5e612c15b138aa8e868a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_3ab6cac43fb1418a242820f5fb741a80.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_45a526f03ac0adef7c3c45cb4cda6d5a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_466a1bc182d81c967fcd9dc2d0161046.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_2b98509c91ffaa3f4b775afdebef2dd1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_24ba9ad6b82850e51f9aeb27631974c1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_64f592e51960d717cdbd7aa155ae6196.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_9ae98cae168d1714dcdd12abbf4ab7dc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_42509ec379b9798b007c4481b1b65118.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_4054e8af99647ab39ef82cbd2fa546c9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_e16698998bf1a04cb9538d79a1ceff2c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_12667c1a7b080c02776120c0a85b9cd9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4f67ef168fbf2021f1b78fb11b22f568.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_f14e429b4f85b7586942a94000a44f21.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c9e281ea445a93fbc84005fa8a92d07e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_6f06b0c532060f9a0c1c0b2f64f2b6ab.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_f87724ae16fe199bd8fb1ac207a3ab99.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_85ee68d4daa7ddab518c19afcd02cb44.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_babb54324affa4adb9249cdae14cf222.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_8c6a9aa2df797ab1a789805eb44c20c6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5b43e33507a6bc64943c2383991ad7d4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_b9c728e7fe649e31114138d69a0b69c7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_39a7f24d933099914037252cc9e02645.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_cecd6722d457eb6bb4b1231e28c61b64.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9d69f7aa4a1a514ddb293bfae46db69d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_99fc53184b728115e2c9bf977d44addb.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_ec6e45525b18ba57e7669697631ed856.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_69e8bfa87ec2c7377f0f3e5bec154a35.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_4fa129b1c39dce035ef12c29e733d88f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_110023b0bf33e516b42bee6f23b6a840.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_3ea83b592a9e001f52872db06794772f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6cf3d04771c2ac3bb39f84bda06a167a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_b5e611d650819fc89af1f9ccfb59f24e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_016a76a8b508815af96b7185d6137346.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_a6321b1baeca3f0e777cc6f735d39599.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_cd61b04f5a5a80de556e7524ab8efa7e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2419100d41a8a73ec4a564889d7a57e9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8103f7c569fd8326b0ae947eefd7d92d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_f1fcbe3b4b5404a79557569199effbf2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json deleted file mode 100644 index fba27d2816..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_2f82a8f66db1e848b6fcf11cf3b40597.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

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

Code

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

Hello, world!

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

How are you?

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

Code

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

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

You look great today!

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

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Code

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

Hello, world!

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

How are you?

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

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

You look great today!

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9cc2ae08193a68d28076303f2d80664d01c7eae33b4\",\n \"object\": \"response\",\n \"created_at\": 1757403596,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ccedd48193aaa1b8cfc6cb50c70664d01c7eae33b4\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 627,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 682\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json new file mode 100644 index 0000000000..450ab7f7c4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9ca8f2481978d4dd49bed9794460885c6dcbd3bef57\",\n \"object\": \"response\",\n \"created_at\": 1757403594,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9cb162c8197b81d2e667a87da8e0885c6dcbd3bef57\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 618,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 668\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json new file mode 100644 index 0000000000..77d0ecc916 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda7dd9948195bdbde45281c2a8a5012a9e7d5e086289\",\n \"object\": \"response\",\n \"created_at\": 1757403774,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda7f2d7881958ba19856cb289f15012a9e7d5e086289\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 588,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 616\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json new file mode 100644 index 0000000000..7ed5579c3c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9c88dd08190bbd9a8d5867d8afb0e6599b4a1fa2b81\",\n \"object\": \"response\",\n \"created_at\": 1757403593,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9c9cf008190bc48ef6798b873040e6599b4a1fa2b81\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 616,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 650\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json new file mode 100644 index 0000000000..87e161a14b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9c713ac8194ae7d46a98f02eee30c58f53c224624e4\",\n \"object\": \"response\",\n \"created_at\": 1757403591,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9c7d1a88194b5d7b2151fd5f6d90c58f53c224624e4\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 616,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 650\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json new file mode 100644 index 0000000000..efe4843f42 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"yUeGBGSHEM5U01\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"O3K5Un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PWLrcBjE3I0ys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AUvYYB4WYxO197\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"wK6AXiH45Kxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Dj9bafko31ziK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"FN2wPisUgUIux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"FHIwYNF3aYnNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DkRsEbr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"u0xUZ7Vsv6bIuT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XuXVVyeQ9Vyff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"aqV6rCDVURJQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"xUTdPwgPlw1cBuQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JUdYoLaiajrhSCn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jU66GF3LYIt9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"KU83YENQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0FHIA2bicSeFx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"5vQlIcJ1jM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"T26m15vnlJR78\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"uiu6Pl1s42\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"XkZNmNF8a1j9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kgRv6M5fG8UA4cE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"SLl7LbuG2Xk06PF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"RB1N8AhsmLkU3Un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"BBNAB282CdbMOte\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"4b2Wf7iEMPo6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JdrC3X3JHRI0gR9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jOdmMANA9Ger3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SKuY502YrJ9wOS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"OX4WD8GEkN2XE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"YUAgdfkfhx3a98\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"wF3hFBdVpGzT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"00LxNswJVz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"s3NsFZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"y0H29EzHlZbg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"ZvvcOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"dtOwpjfR7OdDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"lFHP6kXQQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"f6N4jQSWEVoD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"ndc95LENx1h0s4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"zDUGCWLYgiV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ABlTuFtoaU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"ZlLXgAS9u14KH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"19LodIReZUy6Kfn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"uEyTssAJx6q3Dd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"6M7M2k76l8sJcGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"0KXGz8iDWMKeqf\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":627,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":682},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json new file mode 100644 index 0000000000..1c6c109481 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uzxC3DUaIW3EYz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"auIYg9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RqexLhzKVhz7n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nUGHIFe3GBVFAV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Xz2EgjKR8j1X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0CeAE3TXYWZYX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"vWS2PlRuWatM1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Gha1KIzvgSkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"NOkobA0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"1zvAWt3W6IwSSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4W0WjTiTV5FKi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"4aA5jVDetPKuA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QciyqvZL9ZjYEyk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"eOxwcjJ9LNEpEnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aIjvtVTdPmcuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"G5RAURwT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"sIxDHAPRMhYDM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"Pj7U2ddHlFE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bhPhA1v9O4adN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"82pAWFY89B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"dEwhi3qAIsyy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GwL49KYjtYloMgX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"A9yFAvx1Xsu3LY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"2ETf6Qx4wLyLdN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"vBV1YfAQ8DHAtV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Gso2Twqc8b4gMLu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"khu967cXpeHDOk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"sjrG99wKLh4J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"T3eBVescUwjyvS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Nx1EBfAmEBIf4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PiGGsS2uaDqtef8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"cvRg8Lb33MJXwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"4EogH2I1rzBfBf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"oen08aLz96Wnye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"9yqRj9VgyOFBH4u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"ndYBnq9dRsfKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"1Fq6XAGhEEta\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"8mnzDFb2PFo8p0H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"y8Zgy4pmzfJKaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"ktcKBHh7fjgN64L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"HPGJu0YAAEImvY\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":618,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":668},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json new file mode 100644 index 0000000000..20c807588a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"RXkIbGzwrYAak2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cKxeJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"LBnIOFwmuP3Jm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"u59koe1nCwDWMD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"dZp4JHG9bFFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"aP8gUHoqY5Fx7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"hzCpmhOBhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"z58BXEela8P94\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"S4gInMTgd3MYff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mm92qhIIjapEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iK48Q0SKimFJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"nmi4yNu8rOYGFDo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mYL3H3tKz1FLTGk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0XMytAyyNpoVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9xClucSIFIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2nAaBygaaLLZG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"k5W3HHhCUwSFj33\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"lbB9LL6u8grpxG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"5j2T2LNV4Yko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"VChKQ5g5QnV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"MggKsug8Wk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"DJOcml7mdq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"1uPtav0MnREVGOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"towu0hDXASRfQy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QaDIYMMZuqLOMi\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":588,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":616},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json new file mode 100644 index 0000000000..bbfaaac83d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tpKPdF6DwcQouD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ouu3dd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"50TEE1m9WkVdi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AhndDzNwmH5Nhp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"lxhdSw8vVl6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Bapf0SJ4N1N2l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"fLrnt3wSc0o1W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3l30HoFMrkmKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"kVhTUVs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"N9O4Gs6byo02H7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wl6orYR03x60e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mm8IGYQoJSV7N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"6cuUcLqr6r9tOAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"SDWuWHWuZN9dJe1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"m982yi59kBEdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"H1iRbx75\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QeQM21H6dqYmV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"l0mNiingPVv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QISr8LmJAXiST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"Luj9bdfnsJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"j6pOB5yijEZC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"63uV9UTSa74ffAW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XYodSQVgyxYwD1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"OzK4YybGC5bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"r1lHoeehncI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"cyB2m8vzSz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"36MGTCZps1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"TD4rV2H5DJVvIzp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"x53f9IccNvTtzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"FJGhvoWcuXeWKon\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8PuSEp2pDyzZmj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":650},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json new file mode 100644 index 0000000000..b8e5fc688c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nr9FSJ92vN8gqi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sxl1dG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SZkXyXJ6l21e9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"82EzkMPARYCqG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GohTKdLztDp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uRe6v7GtLobUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"7gk6AoX1Ww9Q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"D5a9nBqBHQyuS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"TwcquD2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"1yNGzACNpqahb0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OpX98fY4WQlB6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"VwfCrOnU6xOMR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lalTKh16P8PkSwY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OtfknEgIccwzSju\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Dj28ofboLPInx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"bgD7LoAP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jpgJyeO05necR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"cLCToMJVWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eZJgYoE5F4mD7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"yfOkTD1W8K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"IM1O4fqF9B1c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hdz1NNaYmqwLohD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FKUtuZPUpeThg6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"LhISTRVHJtTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"uoAAT65a4GL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"va6v6WtY8V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"RluRmgG2MN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ud7fb2tYfbMmBew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"7baX9ava3zMD3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"NYlX7x5mNpYr9Jc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2Le5fTX38hsbzB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":650},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json deleted file mode 100644 index f9cc5b567c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_a6c32f94ed9ef180b605d3e529b66f0a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, wereld!

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

You look great today!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, wereld!

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

You look great today!

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo

\"},{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

You look great today!

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

Hallo

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, wereld!

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

You look great today!

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BrfV8lRQbKXwOcxFfKSUZXYilZVa4\",\n \"object\": \"chat.completion\",\n \"created\": 1752130614,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_n4TQAcEJpH52Zu20AYyhtfSp\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

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

Hallo

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_WlNJzG1hbzzkKftKBmZv9ujL\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUi9NmZ8JBtfDBQFhRTcB3eA9wx\",\"object\":\"chat.completion.chunk\",\"created\":1752130588,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json new file mode 100644 index 0000000000..048073c528 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9f0d5048193b9600926cb2d2d14064b14b3d7b82cc0\",\n \"object\": \"response\",\n \"created_at\": 1757403632,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f131a08193bacc0631f7bbce65064b14b3d7b82cc0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

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

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 721,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 777\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json new file mode 100644 index 0000000000..6290fcd7ef --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9f25d7881968b72cffeabceff530c3a6e0042a296bb\",\n \"object\": \"response\",\n \"created_at\": 1757403634,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f30bec8196b42eec4fb81d721c0c3a6e0042a296bb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

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

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 557,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 611\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json new file mode 100644 index 0000000000..0b431339ab --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CJRe5lvCc5ecC4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"HmiS3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MpJl7tSvTKoGP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"07vKYZlkCnEkXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"whMjTPjnN1FX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fjpnF0rcSsNhm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"e0RYVdHKGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dm7PKPepFUzTc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WilJnjGkFfrGcN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zbNwcqUPIrd23\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"s9sIaI3OR0lII\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KXmuNi5b9QIKxuv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"p7802PRmt2RMbV3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yPSrx56FCT0Hp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Uq8NcY7DMGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ezGzUm9FqaGsm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"7XZrXWOFIQtOHC6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"aTNFf4q79oGFZYp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"P0U13bUs3V1fN72\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"ctlYtF2mcC3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"cMWvgX6Tp6tM7Na\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"GNvo2XS3f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"PYhwsnun8toLom\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"Pj6GThphJ6Rm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yK6LtaBwoV7w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UF0RrVBJCTrfA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"TPWY7GjKPZAiy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pREcXPHbLztDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"IsYYkNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"djhfvZ7JWdviYn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cK9kiYEqbiuiI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"x8Rq6FRgCA8ye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Q5LPLRaXye7ngHs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5Fx5kkniSskXCqU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SEEamXu54Jcy9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"B7HVPkZO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KsJTDxS0ZHFnX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"Ew9Jpa0127Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"j7qqHFRkJ1xB4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"oxdLKgJV4d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"PG28mFKhfITZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"V5dRORALBGRBAJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yDVQCSMxKHNDq13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"444pPRavThQW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"HzgrVnm4RxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"jEvffau6bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"SF0Nbl89ok\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"RbxUTqeg7UL24JT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"BwbIrVQBoicLnh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"FVkvdrDuicPSt6t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"LSFP07tgFavRtV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

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

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

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

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

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

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

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

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":721,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":777},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_6a59628efbb4af73805eb2359a908f14.json b/packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json new file mode 100644 index 0000000000..6a5440fec9 --- /dev/null +++ b/packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TqZ8PbIsy1G54q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AnnmKf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Vk2s2gOqrfbE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"98gkVBh9rkxzvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S40Oq3QsdHhf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xzJfEo5CRevOj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"p44jpCrxT5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qEhxbi8yz61jd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"V7Oz4WxzGFPuJL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"R8Wb0Kdm6pXeZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"uQwpRUIYCBtw7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2ndWV3dFJlPXDLm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ekqaXGNna1W4S2U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"h5aGnjAEtGY0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"o1FNjr7BLiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iyj2cvycToVh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ASluxTIzbNVSeas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"mMb83FH6j1wHb0f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"bnpiY8LBYbWRtW0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"tiEYT0Zfkcw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"VP5JM0Xra9oUxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"6AnuvHfwVzPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"K6efGl0EYWkk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OcewMTOecpPzT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"sWC0eMWrCSYFb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uZyaxpjasvGS2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"ZWpZLcB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"sA5dfLfnFK9QIi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OUJuoWnOaW9sp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qG4uNbFflnwyt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"scIAW5s6ncuLlbW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"xJr7tUpzqRTqIme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qNyOuqaQsSkH8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"AAOWxuWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2fdSFYhoibxI5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"pkWUPVsXAn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sNQdhQmQSKEAu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ZG0UMvzncT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"NgIrQ4nbUJGf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wpNIJIChsuT0ySB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"px5mHifoRweG1Ky\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ZSR2wf7aY1Zg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"kyd5PBggl6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"0S8Bph6Ad8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"SKMH7P6OMl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3SceOr9zYVrG7RR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"pO26HLzLeNIamJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"t9Ps8ikT5WtMybT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uTsaX5CbVYmtum\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":557,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":611},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json new file mode 100644 index 0000000000..047e691da7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9efd40c8190bc3bc916f533801b0ae51576d4ae2da5\",\n \"object\": \"response\",\n \"created_at\": 1757403631,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f053748190b82b1ef212e6cd6a0ae51576d4ae2da5\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 714\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json new file mode 100644 index 0000000000..668d073656 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"V7gqh8Iyw79srj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"WQM02z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"TQdoj4qpXDgYX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2KCLRQH4yG9xfh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"7yzgggN0bI51\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eSk86oWsy3CV7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"hSlkjPPSyR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OHGirNLgJOQM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7SiwmPv5VzaroI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LPN2oNkmvgMs1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"v970cuLl9u9S1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"YxCLNNxC2Htm4Xa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"tfMIdrOtYp6vtsF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"fdSeDfJEfLd2h1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ySuRcx1EcZCGO8\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":714},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json deleted file mode 100644 index 2c379baf63..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_8978afc5c34284715a8914c2fd570f93.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hi, world! Bold the text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hi, world! Bold the text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world! Bold text. Link.

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

I need to buy:

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

Apples

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

APPLES

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

I need to buy:

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

Apples

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

APPLES

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

I need to buy:

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

Apples

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

I NEED TO BUY:

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

I need to buy:

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

Apples

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

I NEED TO BUY:

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, @Jane Doe!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, @Jane Doe!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, Welt!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, Welt!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, updated content

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, updated content

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo

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

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QALgGGSC9WGQpSnLMuvRgD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011JtuhRpotkQ6NVzZYREhfS\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
  • Apples
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
  • Bananas
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":980,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":101,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json new file mode 100644 index 0000000000..ef5a4ebfbb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

What's up, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

What's up, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

I need to buy:

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

Apples

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

I need to buy:

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

Apples

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

I need to buy:

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

Apples

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

I need to buy:

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

Apples

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hi, world! Bold the text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world! Bold text. Link.

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

I need to buy:

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

Apples

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

APPLES

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

I need to buy:

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

Apples

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

I NEED TO BUY:

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, @Jane Doe!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hallo, Welt!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 641,\n \"completion_tokens\": 27,\n \"total_tokens\": 668,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": null\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json deleted file mode 100644 index 0161ed9c83..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_3308e5066e651a6abeb10e26cd62b8c2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, updated content

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 649,\n \"completion_tokens\": 27,\n \"total_tokens\": 676,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": null\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json deleted file mode 100644 index 19d70afe70..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6fb8402fb1c0ef42821646b7ae01a6f8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

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

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 639,\n \"completion_tokens\": 30,\n \"total_tokens\": 669,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": null\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json deleted file mode 100644 index 80f9f36a16..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_ca614a9ed0162e6f24732e67e6076cb1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 646,\n \"completion_tokens\": 31,\n \"total_tokens\": 677,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": null\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json deleted file mode 100644 index ec21a4d1e0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1d9ae8d2cabb0ab2d3425b42da65f9aa.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BrfUqFaDOzJikUxk9pO0VJo8MNSFL\",\n \"object\": \"chat.completion\",\n \"created\": 1752130596,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_lEQMBzEYQt7baoHlrSIImCxU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 486,\n \"completion_tokens\": 25,\n \"total_tokens\": 511,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_07871e2ad8\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json deleted file mode 100644 index a87bee39b5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_c329ee96e44a6acec8c490bfe9036c3c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-BrfV3F9r7tmQZGBoHVYnWfAlixucp\",\n \"object\": \"chat.completion\",\n \"created\": 1752130609,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_qeqQADkdvIbCQ1n3rHUAmvM6\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 432,\n \"completion_tokens\": 55,\n \"total_tokens\": 487,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_07871e2ad8\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json deleted file mode 100644 index c0e0b41c49..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_99c94387729dc443ea9a142027ae75a1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

What's up, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

I need to buy:

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

Apples

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

I need to buy:

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

Apples

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FKQO4yAzQgFwEUZzzN4VgyMi\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" geht\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Dieser\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blau\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfgHxUPjsL1p1yMxJ41qdz9s7unJ\",\"object\":\"chat.completion.chunk\",\"created\":1752131305,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json deleted file mode 100644 index 522cf49218..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_dca280088154bf070ef536e89a0570c3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_iZUqIhom5xwPTb8kMZOW2id4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUWQaTGdoaBSrBY3nPyVTobUO7B\",\"object\":\"chat.completion.chunk\",\"created\":1752130576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":null,\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json deleted file mode 100644 index 6e0ca4c606..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_290252f83e798ac47770abfbb9bf6d73.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rUETqt7C7MZKipUEacJ6h0kp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BrfUeh8QkmrCh9rIlvEMmKND1DQco\",\"object\":\"chat.completion.chunk\",\"created\":1752130584,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_07871e2ad8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json deleted file mode 100644 index 1c7755b6f4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_282445e6005328e75fc2768da3503c3b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9ea38088195a18bba8b25024e690f4c9e0c66b4e831\",\n \"object\": \"response\",\n \"created_at\": 1757403626,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9eabe148195bbf82a062060e67a0f4c9e0c66b4e831\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 717,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 751\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json new file mode 100644 index 0000000000..1b27638c27 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9e914bc8195bffe916aaca6744206c251dd6c269d8b\",\n \"object\": \"response\",\n \"created_at\": 1757403625,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e980c48195b1e75051c1ed6e2906c251dd6c269d8b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 711,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 743\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json new file mode 100644 index 0000000000..1bdb789e99 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda91e5a081958a8ff00e450aea940a016e56b1ec57d1\",\n \"object\": \"response\",\n \"created_at\": 1757403793,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda92519c819594ae83cd89dff4770a016e56b1ec57d1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 602,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 629\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json new file mode 100644 index 0000000000..88e886293e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9ee939c81958dd8c0594bd760da0d2ae83ae0da4c14\",\n \"object\": \"response\",\n \"created_at\": 1757403630,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ef16b48195a0b94a368b4c09a40d2ae83ae0da4c14\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 632\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json new file mode 100644 index 0000000000..3f9c909de6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda8e91688195a215c45d612b4fdb0642c56ebbcd0dde\",\n \"object\": \"response\",\n \"created_at\": 1757403790,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8efbf881958ab21856700c58ac0642c56ebbcd0dde\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 709,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 756\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json new file mode 100644 index 0000000000..2aba3cbd22 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9d0e8cc8190a47a23c7951f0ee400b8ecbf69e8fc92\",\n \"object\": \"response\",\n \"created_at\": 1757403600,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d15fcc81908c11dc04b9a13c2a00b8ecbf69e8fc92\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 728\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json new file mode 100644 index 0000000000..2a2835f2ee --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda95faac8195af25603668214901038f9be73ff7e1ad\",\n \"object\": \"response\",\n \"created_at\": 1757403798,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda9690c88195a186d1cd11ec9a4a038f9be73ff7e1ad\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 702,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 67,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 769\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json new file mode 100644 index 0000000000..87b05669c3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9dcc7088194a080d50f3eb3d2f40dd74cc9f1ab9d11\",\n \"object\": \"response\",\n \"created_at\": 1757403612,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9dd34fc8194b898781e57b864970dd74cc9f1ab9d11\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 718,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 768\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json new file mode 100644 index 0000000000..bcef2623eb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9d7a69c8193a8d3766959f805a703b20afb3e81a3c1\",\n \"object\": \"response\",\n \"created_at\": 1757403607,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d88f188193817d870a87230c5003b20afb3e81a3c1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 708,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 736\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json new file mode 100644 index 0000000000..67da0777fc --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9e56f808193a47f462aede84cff02097290c49c3e34\",\n \"object\": \"response\",\n \"created_at\": 1757403621,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e5fcf081938b1ba1b94708f4f202097290c49c3e34\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 72,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 772\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json new file mode 100644 index 0000000000..01172d3c5a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9d96df081978216a783f8a8da740acfa2bbb605b6dc\",\n \"object\": \"response\",\n \"created_at\": 1757403609,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9da03348197a17fd16f14e3bb820acfa2bbb605b6dc\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 710,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 73,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 783\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json new file mode 100644 index 0000000000..1275c241a0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda8bd5fc8196a0b4cfb0be562be50626755b23e2aa86\",\n \"object\": \"response\",\n \"created_at\": 1757403787,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8c3be481968fd262785e01380c0626755b23e2aa86\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 729\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json new file mode 100644 index 0000000000..dfd711ec4e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9dfd6988190aab4ecc4baf449810b8a3960293a0b20\",\n \"object\": \"response\",\n \"created_at\": 1757403615,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e18c508190b96a7ae0033607a50b8a3960293a0b20\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 705,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 737\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json new file mode 100644 index 0000000000..d89bd53f07 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfda86e1dc81979d461e1821e682140653c55214b0d494\",\n \"object\": \"response\",\n \"created_at\": 1757403783,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8840a48197bcf50df973728fd40653c55214b0d494\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 540,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 566\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json new file mode 100644 index 0000000000..d2f9584d63 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9ebd0808195b6eb9eb4ecf68cc1008a0452007e913e\",\n \"object\": \"response\",\n \"created_at\": 1757403627,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ec560c8195b84c1f8045bc4cf5008a0452007e913e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 486,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 542\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json new file mode 100644 index 0000000000..1e6f45bdde --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9d6400c8194a7ac4b6f717e35d40c43b7132c1a4d43\",\n \"object\": \"response\",\n \"created_at\": 1757403606,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d6b64c8194a6c4ec8e9f133c370c43b7132c1a4d43\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 711,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 742\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json new file mode 100644 index 0000000000..988115fba5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68bfd9d55f6881969d329a9f079a891c0dfe90ef9d6eee67\",\n \"object\": \"response\",\n \"created_at\": 1757403605,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d5b9648196936f02920766e8770dfe90ef9d6eee67\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 729\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json new file mode 100644 index 0000000000..11970c7866 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"1ofGhtQmfxzMOb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sxtBfN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"btZE8hhaNiuO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SN5SpVz1YuLoMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"YtkJbldOvQwG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PXWmhJhwsq4mN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bhIHtaPb7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"X4HciK3cQnHOz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OTY6P9lY8KbJHA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hH69vpcBgkg8j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"o57ts1nESao7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"GHgvIzv1NAWgLJp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"1jBP0ylwtNZSszf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eVLkbC2q1YHKf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"UIBz6B3Vdbo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xNpKeP7PTYIe5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"BROjnw2SQglVmVN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"jCuwNldoJoIGxxc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"187fjYqR3aiPesS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"aVMehd4sC6ORbB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"yIH6Z7fCK5cDdpW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"aEU7sRPN21\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"2rCxAnN8S83Yvlc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"9pjEH0WWxzw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"oMJEZmFNULFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"3DB2AyQb3SK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"DT3uSwMpe23rP4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"Nejzt6KJ8f1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"xwjmUYCeEJ1Z8bU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"unolH94ZHh3KLM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"CDPHguu9VG2ozl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":717,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":751},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json new file mode 100644 index 0000000000..a4574487ed --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nRh2hbzRFTq6q7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pbBcLH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"B7RJtQIN9CibD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GgCAwSwg7uNwk3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"heC8tW4J7TN5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Xn4pzE4rucL17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4ASHZr5AZd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"FmeOWI4xwrLgN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"JipbncuKxnVS1v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"22Ejut0FMqkKb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"xm681VWZ7wqv3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"jDiYMMDZn6v9QzQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"II6Zz2JB6awgP8n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LFKJpCiQirkL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BI7OSoLsMy8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WYMGDVrIrCif5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"P6fcLnhXR0RlZwT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xjEzBbbxjbbXYJ5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"SAzWwOAtbt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"fQ0Smq6LRWwgV0b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"oXqFAS3Eoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jG7kFhuyXorEgOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"rdBjnl6WVXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"4wbSuH816Bb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"8NCovq6840ZKaK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"bhuvHUCBQHy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"4x5dmpbj7MDVQs4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9uOZ44Mie5PIJv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"lVKt70jNj7UAyA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":711,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":743},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json new file mode 100644 index 0000000000..d2918f1df0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8lViGS7rhjvyPJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JL6j8v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0rwoVFo3rLFVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"556Uyx4PxBNsUs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bIRBDabETfT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"as0drDds0Af49\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"1vIqKZCkdn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"A7RnVuC5J1hjn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0ExqZ1ss1vKgBe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WVY3HHNaZz4yY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"QP5UnfR0GIFw8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"dNXTrmyZh8xYXMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Owp48NzJ6by3uHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jDWlv0s7XTReg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"O2bzvNLSn6t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iuvIQotrb2EF5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"0iARQMxbt014hks\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"1yjX02bAdi4ZxPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"IvEKqbvrMIFZgQw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"fNSIXUJ6lHwoK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"VJViyNGfAj3Et\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"haelJTZMQIDa67G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AvdUjqsJff0yHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"IlM29NM4zrphn7\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":629},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json new file mode 100644 index 0000000000..ac213e80a8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

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

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OjTccOtpUFyRlA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"los6VP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"WcdRv72mBYf4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GBFiyMGpbRHVD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jvAKNWT8ub0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nmr8LXFBjAZsT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jxtUgPLLSV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"trI9dtqGIxYDL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"SjyOE9I9XqdkhQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JXxmua6nnkav3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"obpmgr2UUEL8C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"IqnH4WiqhDQ90TS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"33RPjbRjUqNpM4j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y142abTwJnnKn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"VTrzHxkn2D8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HzdVnkzODrH1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CqiAga8uRewB5FM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rVOO0qEo7lTmokZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"Ing1v60pshYypO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"VWPPC7j2tVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"8GoRuYMRZuXcH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"bJNYwCd6shEb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"cNxXd7OCyboVcAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XXQsraEzhUFNnj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4nVwSCstngPrKu\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":632},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json new file mode 100644 index 0000000000..a47721ab60 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZEK3CsaRTrB8PJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"apVGaM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cKkbwxY3FAAL3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"KHjkTUiTgJ5Uy5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1l8G7O6CPhFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6bkjQiG6os212\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ImSFx4zDPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KrdUPgop7j6Gf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"coBZUmkHWGsKUh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BHcjlkq1z77ls\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ETTtGWzlWySZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"MfkBPPo9paON8Lp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nkJyTtPVW9aUT1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"USd3ZDeNQICUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"vsO2sqBLDjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WNYBkMTUn8RNn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pFuGwygMNSJq7uT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"K9y4hmuBEcQ6YUQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"eDv5aTSCXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"O8fDMu67d4NmUD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Usd8uWju1yRJ4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"6J3BQsanikrh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"wqtPKXJ8eNq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"bPyYeg7YU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7SccePq0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"UynlMBk1ec8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"egnEJLcorx3cD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"E0Gv5huBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9ykRzk5ECyIiG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"y44M1c4YtHZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"6HehQzr9AOF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"45C49CXY8Lsys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"YGZYZlE0Onh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"HbCaIsvGDM7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"gs1X4F4IwTvVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"pKVa0sUBGjmbgbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"hvHlC5efSFos\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Kow1ihWdEhht\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"MNLZaXKYR4zjszR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"bMaPL1CJnRd3gkh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"PQieB5dUuDrEdz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"44rVKKti5I2P5D\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":709,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json new file mode 100644 index 0000000000..4f096e2731 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tehFRtYIwLExaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"IzEpHM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gwlEnzBpEMjwe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"U0ejLbxOKsQat4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"FnNsizTrjosj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RbBOLOrCK9tEz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ShD7BfwLAY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lg8o2Dw5O6l5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"gk4aakFr6Wt0xG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jk8qTsGgrtoWn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Y3Akdv2iXigjH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"fvVKT5Gk03OdS6x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Ub1SwqDlNQJJE3x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LOADFSkqkq5U9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"56UTGNKS9Ox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pboGkqC5TeJoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"7pbnxpDpBj6wsrD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"MeVWABY0LAZUyZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"PicTWdzlEUHzjDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"390FjsRDwdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GS2rGCQoxpunIbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"OoTUv4HtsgR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"d9MFSDeOXqTiLF2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"udRljOZbljRxnS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2AfI1ztnIiaByS\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":728},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json new file mode 100644 index 0000000000..b55905f8eb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"bC72iduBUfXyl9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"hLMkH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"pc9Mqmfe7T4NO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"A1uTs7WcegNxkx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S8kNNLvk619Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eRKiBvkJqamw0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"3M3DR39gUZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wuDLgl24OlR86\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PuLvvQkDGYeI7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oVuSQHZvf47om\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Bkln0muD3A8JB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"H7QeH9N0CZORp5A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RLimPR9wXZ2SPOs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IZzrQ7zGKnZXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"twIzpw4DALM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"g3fbVfnZnof5h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"KtmGN90BqDXpFhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gACe84u2NIO7Jqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"uqhwWAPjt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"utWTGmX5ZEcvMRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"qv5G9n1XqXwkrf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"THjNG0JCnwHt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lpGoplOKXr8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"Mzk22Gxi8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"kE34kIUG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"tJvOTBw3mox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eQo4ys40e9SGZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"rUTyxxHXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"V8Xf1VRVe9pRoB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lmhdJW0f5Og\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"lVcFizL4tcb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Zm7UoN6etwBB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"IHLmSXH7FXXC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ZgetsMvlsr1l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"iP3FqRv8JV981\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"5jWebhA3KGuORsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"YEgxUzZqHwAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"5QZo6z4dC17u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"ewMlFt6YZipQXqR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jlWQkDYMJqAUsHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"Ylv324Twv2xX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"5ex0Cdn5x2hG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"jW4qzDuUIwJF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"YgjohFVZBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"4S1yC1uLxN7ghnp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3MM6wD6NTJp34d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"kIFDbqaZp9hM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"uYsB5PgLMkN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"l54OZ1DOCJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"j36uLLvFEW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"p7ZXkNp24HbdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"A2WDlGXzSqpa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"bUt5DCA8sOGmW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"SCN44Uv9KcYe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"HezRkgnud7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"0PosLViKmg5Ft\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"xzY67LnjOW6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"g1UsSm0gzbEAc5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GGoj1lIta1faB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"CTnrUNTxwZP0CD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":70,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":71,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":72,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":73,\"response\":{\"id\":\"resp_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":702,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":67,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json new file mode 100644 index 0000000000..14238fb041 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"JQfYqmVYEafmTl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"40qm6V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Py30gxAJvB99y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UREUJUsc2Yodne\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BpgFly6p6LFN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GK0KGLpVRqWKJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XmGdjNpCo4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oQbyJwuDPfp4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"51rmNlU7bYPWOp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CY7ehNK16YS5T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yjeDEkMeJNnc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"lqmHEWuagQNF5lo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NebenKwu8rvYsHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"R1AUwtXr4uTnf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QVMCPR6CNSp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7Gr4XzFVqxPsi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Xy5BG5IEercXAhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"cNEBPdMSRCNLOGT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HaYgcKLevW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"HXF8pEXLlopDokf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"9LAcy1wGTMDJaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"IsxWqX8GBd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"JzhBIPHUwmp5Svu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"j8WRfD90WrhCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"Ry1YTZaMl07a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"eBAPJWv0QaAd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"ZCfxDCMRRU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"fCQrnJpCQg379BS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"j1m8ISc7nqVsze\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KuiImjAWMVI1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"IoLf9VF46Ek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"BgeOJWDEWsm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"TOk9Hm90oa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X8V6pWbSQzNVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"BMcwyslzvWzH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"W6NT1uVbPRen6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"eOHTyc57XA2Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"QVRToaIgWkn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"NFklHNrd5FMJ8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"vxGLsY2aiC9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"zg4JYXs55Og8zTk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"pl1KUy8fDrPigl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nS53grITQMa2dr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":718,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":768},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json new file mode 100644 index 0000000000..1727ea5ccc --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XYUX3dtGlFRKk4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ylaO77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dmX1Dhof55oHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"o4FgfLlBGYpGhy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"hw7LZvfUe6ox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5r2WGlYM95JF1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QWOrqJ2HcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YPJQpPclrI2bb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"vDrvO50bwhZ1xB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OM1DV0eydEL41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WLaSiHPdm52kA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"7UfxEwzm84138ff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QlZXxemQ0Asheyj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TlTae0bpwlIDn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"dwbsrkmMCVa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jhwfaqod8IDiB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wHK4QH8gzYoA1mE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tIQVfcQuDTfQJZO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"NStGDZjDon\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"JHW8mBR7Xbqbvh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"8NZKm6uE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"9Z8A4Xur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"uJOihODqnIIm8s2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"08RZ4KYRvp9wH2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"r2C3AU0YZFfDrt\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":708,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":736},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json new file mode 100644 index 0000000000..272c689f9d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Nf1LmAo6GxLRbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"vh6lZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"zTWzXmLfhL1sN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UWbuI1dwDFeCRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bYKC3nOG5DgI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WxddI2xQc3rlo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"spaOVUQ0QN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"b8QEW8yCdou7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Gth6qDRIyXzqO7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w5P428PITaz8I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"SKsvbKuvYMNwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tghfcRv5T9tWbQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"osfUtWOJPZnHMzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eoKqEtAfFBEUd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ZDwvcb2pcPT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"M3OEQMYwaS4v3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"nf988XIsZjCIhaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"VXFDaJPyeBXGN2k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"ObA0ha7wU8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"V602cr9vQjY3saf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"eZA2pX2ZJuU7pi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Bd3JUiiGgw7E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"wZCjnZBRE7K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"ueO50jeeP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"5XNRPc2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"2k9CFH8yVey\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"GhWC7eusr0lLB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"SpsQ6bhD4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2Bh8TYRdTPIwF0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UiNANRMKVwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"4BOIj1KChh3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9eSzURV8xHVXj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"VRnBktFHNEq7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ZOo9IQkWIr24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"RX0aGNvGt0ynq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"5uw5mjhMOfpNfUX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"2We4RQzlMXo5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"sOyHPvWjLi6a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"lATHY9K3NhGsl6K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"76ZxZxmuwWWHSO2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"hkBJbq60J56lui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"x7pMD3Dc0X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"a5D2SD0X9ZjYAUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"XRF45Ae1sN5q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"SEtpN6OwXvaW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"vn1ChAJpO9so\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"bCnGQgTpDf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"SuM7YzoprQWw3Hx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Fxqon62RoXAT24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"VAwhpvDHxcUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"vcgE4avcnI4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"ux6ERieuuJt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"42yxCI5jqk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bhURlRfvtsuTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"NwIS0f7LrbsH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"4E1bwEpFKFdfR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"jEAdLq5bTrQz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"ouKXNNilESV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"qBVoaw5Ev1Ze0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"iECyicQsD2x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"NbqGd0ENcbpsi4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"JqsSV83aood0rj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GqZJvxMXYKlXbj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":75,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":76,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":77,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":78,\"response\":{\"id\":\"resp_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":72,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":772},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json new file mode 100644 index 0000000000..da8fa225bb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fYViooYJJ2Lcnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"RoWe9J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cdO0YDLe2hNZq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4rMtxGhBRTcxbR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gQOahYbo3hXt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iOKcwAWJlBv11\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"zdZ8WzKCvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ekbR86243QiFU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Rje6JfKC95kL4e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"18J6R9MTZUc13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ZjZIf59AVBY0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Buto3gskDZAFkfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"WsD8CruPGoV8lRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"MvqYF47pZ3Uz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"xqqwHacAXmS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eJIBVczthe3FG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ayPSm93v9bXjGTm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"l4EI1NJw9V14bM9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0sg70mLTrRJVl2G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"eWB3TK0nu2P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GmyVm72EzAZDepW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Pg3zlACbcVICwM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"5LRUT0L3EpBK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"d2BCGMOR4oQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"UDXxYRzj7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"5eCkbKpJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"qVFQWBSFDWM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"S8Fdxf1hsKVen\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"4rNDzqUXd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"8QWyxTQpx4WpxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lncyClL8zYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"6GkDY4SE2IF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"sMNTmhOLEkzXx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"Xoqu0Qw7bsiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"5H2QuZQi1UYl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2h8atWOpsg8cU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"Z2JtSmJZGDV6Rf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"P5tIlqdP93dS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"dG0z1FPrCzX4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"3ibEbzFV5pIc2Cy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"PpmzjyLWOxGe36H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"pRC0EpfyyHPlsy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"4dAxkFoBW9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"hONfAwGDLL5DbFk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"wMITaVSFeXnbC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"UUFFZU2eLr6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"nMhbdGkebd36l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"z23SBKmE4558\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"QDXp41JlkouGwov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"2MIYSd1ZhAkIn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"gJcc22BQkR8r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2ilFjwU2f60\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"gxEd7TO4wy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"5Ci8PXptDV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"h9g6hWFGJ3vXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"lIODgbpTN6il\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"Fgv1rRldCVYYQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"JE8wDNuzNR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"IC2GkPZCNaW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"M4ttVoAMZOqn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"lhJFZjOZRUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DamvzbBoOFGOpgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sApJEybsvEVowY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"0JPq9jFQS2iLGA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":76,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":77,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":78,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":79,\"response\":{\"id\":\"resp_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

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

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":710,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":73,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":783},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json new file mode 100644 index 0000000000..82a07871be --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"g2JgsZKekr4s10\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"rC8rYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"X9baoJWPA7cIl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"xjAzjPUYXuIwkT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"u9EacTCxXvas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x4EUk8ZNCGozo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"d2RmZ06ofO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"s9uSzbpvSn7aN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"G6VL9pLor8JqJT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"08fxqvCPqV8LH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FU5TieXdkDZwI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"B1DlXmuf8rL9l4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mwrs3VUH6apmbCp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uwSn1jO8WbFjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"h1vciKmTPck\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"btRoKvuqu3jTn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"WtdopWfoFl4tvU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ZKWhSEw5lF0foHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"28E916zVRLreFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"mKNYwiG6xS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"wkQyh21pjp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"EIwfBgCul1TRuIO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"2A3G67oHZX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"nnf2zq7JhO5tj5X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"V1AF2BRdmVM2Qm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"hQRTq9SxH3hm4N\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":729},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json new file mode 100644 index 0000000000..de95f8223d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qNcAMG9AH71o88\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"KStEqN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"qBqoIHHdvuY6l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"9y9CXAkt9uxzMF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"G7F2HTuLuBzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KnM3tJ9n3xNob\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6LcfuxgkOk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oL0NG7B1IQ3mB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"naW0Tw9XPG2hkN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4437Lph2WGLAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iVZGITx3xXvPd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WeKcslJ5lIwcRaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"vQ3B3pr9gGKUOcP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"j3rSeoQT41elN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"z2u8zaADyU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ug7xAO223ngFl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pcOWZdBIxSqnIho\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"DKe2g29TIDenDHf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"Mf7dvqu7i1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BFleasfBYdvFpbH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"pdbSD2QJSOLCOA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"ukQ3y6eOjF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sbtrl83AGV60VXK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"62j86QolA12\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"OX04Auaou4hJhcH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"TAvrkJ3tWIGqqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RO9S0S8QeVbxin\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":705,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":737},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json new file mode 100644 index 0000000000..693fe9184e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3y85POk9DLDpxC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yH3pxK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dvf1SKokObrhi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k6xxbfauY1J6Nt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1BvZlvKU1njn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x9rEMrvfBHRDw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"t8w4qAXngt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HJjvjjyVPZ56L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Nhmm1fVMCm3Rlt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N8req3PaaTyGT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"vtZFuo67eDvGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"4Rc35BTpqvdWpG1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"XkE6SX9iPr34gC9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NrUXAjLxq1bS2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qeUxgwg4kSj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7PocCXoF6SUod\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QfyWXLBlxgHLrfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"AKEZ7MJs6dg9ppq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tF2zV8SCxVkQgBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Vr5No9n2tzU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"vHKbrTJMtpYi1ev\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"qu5716gMSGKlAk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"lq5v0pqAX7t8eN\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":540,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":566},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json new file mode 100644 index 0000000000..b91e5614ed --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

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

Bananas

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

I need to buy:

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

Apples

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

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k1gWvt1xFTzztl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"PojpDn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"2ZG4pAqjBQene\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"V55QkjQ37cp6su\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AngGfrel0xjU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8l5pMAnlC9J9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bp46x6pXV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YpYaPmT1xCSof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0dj0ipNC6MFftC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fAcZ5WB0VuDLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"5vbNLzImcqoYg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2sOuP9YT2rAXB4a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nachvCERkyfOoTR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LlikkynLk8Qcq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"G32Xxe9LY3r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XwDb0pUPhoOYI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AVvjEd7RkFAg4dG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"3t5CwtXHpV6vTt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"JoBWYW4WhxVMIy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"HpgHDLhkuKz6iW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sIXOd5RRxRu2oOu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"aDqEJWHRBN4HI1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"Sc8pMlW1PQwm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"DTXwBirQRDyQOC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"Armq7SnRYMum\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gOCoyYF3C2yI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uOjqDbusfdYkk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RiHkdu0sMS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xk6Fb8nE09HZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"A6ZbWFvEspb1Rq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DmWPI5BqvrA2C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"M7W1gTJv4Q2Yh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"56EfJ4ia2ra87Ib\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"BauJnPzptTG85xf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AonTXrj9hzAa9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"UnAvvGSd8L9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YkSrujgKj7E65\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"dI6CtocsDyCBlkZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"IEr6qsemVYKNAV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"4v8iTQ6walTePg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"qjeawGFigMmnBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"TGnWZcoNh1JVShn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"KWnfWIJKJUWng\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"mFgbS34ZGwHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"tfQxcgnWzC5RQ5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2W0v5SU0Kg3xr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"mczW6GsJ9IWIwv\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":486,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":542},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json new file mode 100644 index 0000000000..e4475152f9 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hjsebMQYdGYlmJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zDMedC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gV2dTjlXymruu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FroXSWGJEa8Z8F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"VfvyEHdGvipa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oQ1jGbSrRZ3Cy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ZEGpiwln3G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7mhKYCZdb0ltg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UGwE2x3J0uwmSh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rRyzdBakKAZxg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JCVfjS1bdvCDw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"y16jmuxzUxIcNQF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MwJmBhWMBnrDNGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"H2qjgohy2gOMb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WiGswy7PSuf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DzvFylCXEiWVq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UhFxTF0TCZyb0i1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"m0uJO41rb917pp3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"VWnp8FFgdbOUy2V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"p8tHrYO3FXjTIne\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"y8aP6PslCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"sBPd65hbgL2E4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"DcUmp9jHI8mPCkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"4MDsfcFwzr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"iZYK7s9hJNv5ylb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"h98qblr0Lxf4eC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"zEGCPaAGmXDeJZ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":711,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":742},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json new file mode 100644 index 0000000000..f49688cb05 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"u2KbmPIjqKgepc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8k5Qav\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"NeH5CrdwS28lj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"x7Q2i1XNgUt8OU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mwqjNXuA6VVC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vAjES0piqlMCI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4NPYuZ1gN1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Kl55oQS4hXIkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"m0iS32Hmq8jDWp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DUOzvWmtLgtMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Q3B2N5MgxKi9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"7QAdpXOsCeWaukl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"0RceZhVmVJbFQ5H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LUhAhoAzsGlO3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WO3gSzvBQZM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dLQSoWYk4OLET\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SZCDx0XsBZYpE5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"aJk33x4BI3NmfQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"74vo3sxjWzLQuvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HvmbheNFdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"u7bDPVWbrokBweO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"HH36k2iP0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Q1AE7b3CxbLA5iP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"OpccsuZEmzrWRb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"epoN5jo0GLC3Hr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":729},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 47c4cf0144..c6e0d4772d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -88,14 +88,15 @@ describe("Models", () => { model: testAIModels.openai, stream: false, }, - { - model: testAIModels.groq, - stream: true, - }, - { - model: testAIModels.groq, - stream: false, - }, + // TODO: https://github.com/vercel/ai/issues/8533 + // { + // model: testAIModels.groq, + // stream: true, + // }, + // { + // model: testAIModels.groq, + // stream: false, + // }, // anthropic streaming needs further investigation for some test cases // { // model: testAIModels.anthropic, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 337826204e..fdd19fa2cb 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -82,7 +82,6 @@ async function generateOperations[]>( // extra options for streamObject ...((_generateObjectOptions ?? {}) as any), } as const; - const ret = await generateObject(options); const stream = objectToUIMessageStream(ret.object); diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index a62b56eff3..742aaa1d52 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -148,6 +148,7 @@ export function objectToUIMessageStream(object: any) { // controller.enqueue({ type: "text-end", id: "text-1" }); controller.enqueue({ type: "finish-step" }); controller.enqueue({ type: "finish" }); + controller.close(); }, }); return stream; From 29a851092ebf35210335d5c3fd36475144ac2606 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 9 Sep 2025 09:57:57 +0200 Subject: [PATCH 18/68] fix playground --- examples/09-ai/02-playground/src/App.tsx | 21 ++++++++----------- .../clientside/ClientSideTransport.ts | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index 137bd38080..3b0bd0cd4e 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -28,16 +28,13 @@ import { createBlockNoteAIClient, getAIExtension, getAISlashMenuItems, - llmFormats, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; import { Fieldset, MantineProvider, Switch } from "@mantine/core"; import { useEffect, useMemo, useState } from "react"; -import { useStore } from "zustand"; import { BasicAutocomplete } from "./AutoComplete"; -import RadioGroupComponent from "./components/RadioGroupComponent"; import { getEnv } from "./getEnv"; // Optional: proxy requests through the `@blocknote/xl-ai-server` proxy server // so that we don't have to expose our API keys to the client @@ -86,6 +83,7 @@ export default function App() { const [modelString, setModelString] = useState( "groq.chat/llama-3.3-70b-versatile", ); + const [stream, setStream] = useState(true); const model = useMemo(() => { return getModel(modelString); @@ -103,6 +101,7 @@ export default function App() { executor: createAISDKLLMRequestExecutor({ transport: new ClientSideTransport({ model, + stream, }), }), }), @@ -143,16 +142,14 @@ export default function App() { executor: createAISDKLLMRequestExecutor({ transport: new ClientSideTransport({ model, - stream: false, + stream, }), }), }); } - }, [model, ai.options]); + }, [model, ai.options, stream]); - const [dataFormat, setDataFormat] = useState("html"); - - const stream = useStore(ai.options, (state: any) => state.stream); // TODO + // const [dataFormat, setDataFormat] = useState("html"); const themePreference = usePrefersColorScheme(); const existingContext = useBlockNoteContext(); @@ -174,7 +171,7 @@ export default function App() { value={modelString} onChange={setModelString} /> - + /> */} { - // TODO - // ai.options.setState({ stream: e.target.checked }) + setStream(e.target.checked); }} label="Streaming" /> diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index fdd19fa2cb..312f73feaa 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -174,7 +174,7 @@ export class ClientSideTransport implements ChatTransport { constructor( - private readonly opts: { + public readonly opts: { /** * The language model to use for the LLM call (AI SDK) * From 3744ec71b595826ece95fcfcc75e73acee569b7b Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 9 Sep 2025 11:42:41 +0200 Subject: [PATCH 19/68] fix server calls by handling schema --- packages/xl-ai-server/src/index.ts | 2 ++ packages/xl-ai-server/src/routes/proxy.ts | 3 +-- .../xl-ai-server/src/routes/vercelAiSdk.ts | 23 +++++++++++-------- packages/xl-ai/src/api/LLMRequest.ts | 6 +---- .../vercelAiSdk/AISDKLLMRequestExecutor.ts | 5 ++-- .../clientside/ClientSideTransport.ts | 4 ++-- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts index 2387be4c96..9388e316dd 100644 --- a/packages/xl-ai-server/src/index.ts +++ b/packages/xl-ai-server/src/index.ts @@ -1,6 +1,7 @@ import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { bearerAuth } from "hono/bearer-auth"; +import { cors } from "hono/cors"; import { existsSync, readFileSync } from "node:fs"; import { createSecureServer } from "node:http2"; import { Agent, setGlobalDispatcher } from "undici"; @@ -27,6 +28,7 @@ if (process.env.TOKEN?.length) { console.warn("no token set, ai requests will not be secured"); } +app.use("/ai/*", cors()); app.route("/ai/proxy", proxyRoute); app.route("/ai/vercel-ai-sdk", vercelAiSdkRoute); diff --git a/packages/xl-ai-server/src/routes/proxy.ts b/packages/xl-ai-server/src/routes/proxy.ts index 59e478b0fc..8febba58aa 100644 --- a/packages/xl-ai-server/src/routes/proxy.ts +++ b/packages/xl-ai-server/src/routes/proxy.ts @@ -1,5 +1,4 @@ import { Hono } from "hono"; -import { cors } from "hono/cors"; const ignoreHeadersRe = /^content-(?:encoding|length|range)$/i; @@ -70,7 +69,7 @@ function getProviderInfo(provider: string) { export const proxyRoute = new Hono(); -proxyRoute.use("", cors(), async (c) => { +proxyRoute.use("", async (c) => { const url = c.req.query("url"); if (!url) { return c.json({ error: "url parameter is required" }, 400); diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index 1b56b35884..1f4d470779 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -1,9 +1,11 @@ import { createOpenAI } from "@ai-sdk/openai"; import { + createStreamToolsArraySchema, objectToUIMessageStream, partialObjectStreamToUIMessageStream, } from "@blocknote/xl-ai"; import { + convertToModelMessages, createUIMessageStreamResponse, generateObject, generateText, @@ -18,7 +20,7 @@ export const vercelAiSdkRoute = new Hono(); const model = createOpenAI({ apiKey: process.env.OPENAI_API_KEY, -})("gpt-4-turbo"); +})("gpt-4o"); // TODO: add support for generateText + tools vercelAiSdkRoute.post("/generateText", cors(), async (c) => { @@ -27,7 +29,7 @@ vercelAiSdkRoute.post("/generateText", cors(), async (c) => { const result = generateText({ model, - messages, + messages: convertToModelMessages(messages), tools: { // add: tool({}), }, @@ -44,7 +46,7 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { const result = streamText({ model, - messages, + messages: convertToModelMessages(messages), tools: { // add: tool({}), }, @@ -54,13 +56,13 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { }); vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { - const { messages, schema } = await c.req.json(); - + const { messages, streamTools } = await c.req.json(); + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); const result = streamObject({ model, - messages, + messages: convertToModelMessages(messages), output: "object", - schema: jsonSchema(schema), + schema, }); const stream = partialObjectStreamToUIMessageStream(result.fullStream); @@ -69,13 +71,14 @@ vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { }); vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { - const { messages, schema } = await c.req.json(); + const { messages, streamTools } = await c.req.json(); + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); const result = await generateObject({ model, - messages, + messages: convertToModelMessages(messages), output: "object", - schema: jsonSchema(schema), + schema, }); const stream = objectToUIMessageStream(result.object); diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index c5c05eae9b..530927a0f0 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -116,7 +116,6 @@ export async function doLLMRequest( withDelays, dataFormat, previousResponse, - ...rest } = { deleteEmptyCursorBlock: true, withDelays: true, @@ -223,9 +222,6 @@ export async function doLLMRequest( }, messages, streamTools, - llmRequestOptions: { - ...opts, - ...rest, - }, + llmRequestOptions: opts, }); } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts index 2f599d4bf3..765b850c0e 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts @@ -22,13 +22,14 @@ export function createAISDKLLMRequestExecutor(opts: { messages, trigger: "submit-message", chatId: "1", - messageId: "1", + messageId: undefined, abortSignal: undefined, - metadata: { + body: { streamTools, }, }); + // TODO: needed here or move outside? const parsedResponse = await UIMessageStreamToOperationsResult( response, streamTools, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 312f73feaa..649797dd73 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -219,11 +219,11 @@ export class ClientSideTransport async sendMessages({ messages, - metadata, + body, }: Parameters["sendMessages"]>[0]): Promise< ReadableStream > { - const { streamTools } = metadata as { streamTools: StreamTool[] }; + const { streamTools } = body as { streamTools: StreamTool[] }; let response: // | Awaited>> Awaited>>; From 0185465143a2e456dd0b5e464cf0028c723b6ecd Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 9 Sep 2025 14:09:32 +0200 Subject: [PATCH 20/68] tool calling --- packages/xl-ai/package.json | 1 + .../vercelAiSdk/AISDKLLMRequestExecutor.ts | 72 +++++++++++++---- .../clientside/ClientSideTransport.ts | 26 +++++- pnpm-lock.yaml | 79 +++++++++++++++++++ 4 files changed, 158 insertions(+), 20 deletions(-) diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index 1dae24482a..bed49e3ce8 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -71,6 +71,7 @@ "@floating-ui/react": "^0.26.4", "@tiptap/core": "^2.12.0", "ai": "^5.0.29", + "@ai-sdk/react": "^2.0.39", "@ai-sdk/provider-utils": "^3.0.7", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts index 765b850c0e..bd8b9b0d49 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts @@ -1,7 +1,7 @@ +import { Chat } from "@ai-sdk/react"; import { ChatTransport, UIMessage } from "ai"; import { ExecuteLLMRequestOptions } from "../../api/LLMRequest.js"; import { LLMResponse } from "../../api/LLMResponse.js"; -import { UIMessageStreamToOperationsResult } from "./util/UIMessageStreamToOperationsResult.js"; /** * Creates a LLMRequestExecutor based on a AI SDK Transport @@ -16,25 +16,63 @@ export function createAISDKLLMRequestExecutor(opts: { return async (opts: ExecuteLLMRequestOptions) => { const { messages, streamTools, onStart } = opts; - // TODO: add support for streamText / generateText and tool calls - - const response = await transport.sendMessages({ + const chat = new Chat({ + transport, messages, - trigger: "submit-message", - chatId: "1", - messageId: undefined, - abortSignal: undefined, - body: { - streamTools, + onData: (data) => { + console.log("onData"); + console.log(data); + }, + onToolCall: (toolCall) => { + console.log("onToolCall"); + console.log(toolCall); + }, + onError: (error) => { + console.log("onError"); + console.log(error); }, }); - // TODO: needed here or move outside? - const parsedResponse = await UIMessageStreamToOperationsResult( - response, - streamTools, - onStart, - ); - return new LLMResponse(messages, parsedResponse, streamTools); + chat["~registerMessagesCallback"](() => { + console.log(chat.messages[chat.messages.length - 1]); + // process partial tool call here + }); + + await chat.sendMessage({ + role: "user", + parts: [{ type: "text", text: "do it" }], + metadata: { + streamTools: { + add: { + name: "add", + inputSchema: streamTools[0].inputSchema, + description: streamTools[0].description, + }, + }, + }, + }); + + return new LLMResponse(chat.messages, undefined as any, streamTools); + + // TODO: add support for streamText / generateText and tool calls + + // const response = await transport.sendMessages({ + // messages, + // trigger: "submit-message", + // chatId: "1", + // messageId: undefined, + // abortSignal: undefined, + // body: { + // streamTools, + // }, + // }); + + // // TODO: needed here or move outside? + // const parsedResponse = await UIMessageStreamToOperationsResult( + // response, + // streamTools, + // onStart, + // ); + // return new LLMResponse(messages, parsedResponse, streamTools); }; } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 649797dd73..55cfe7978b 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -7,6 +7,7 @@ import { generateObject, jsonSchema, streamObject, + streamText, } from "ai"; import { createStreamToolsArraySchema } from "../../jsonSchema.js"; import { StreamTool } from "../../streamTool.js"; @@ -121,12 +122,12 @@ async function streamOperations[]>( throw new Error("Cannot provide output or schema in _streamObjectOptions"); } - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + // const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); const options = { // non-overridable options for streamObject output: "object" as const, - schema, + // schema, model, // configurable options for streamObject @@ -156,6 +157,23 @@ async function streamOperations[]>( ...((opts._streamObjectOptions ?? {}) as any), } as const; + const ret2 = streamText({ + ...options, + tools: Object.fromEntries( + Object.entries(streamTools).map(([name, tool]) => [ + tool.name, + { + ...tool, + inputSchema: jsonSchema(tool.inputSchema), + }, + ]), + ), + }); + + return { + uiMessageStream: ret2.toUIMessageStream(), + }; + const ret = streamObject(options); // Transform the partial object stream to a data stream format @@ -223,7 +241,9 @@ export class ClientSideTransport }: Parameters["sendMessages"]>[0]): Promise< ReadableStream > { - const { streamTools } = body as { streamTools: StreamTool[] }; + // const { streamTools } = body as { streamTools: StreamTool[] }; + const streamTools = (messages[messages.length - 1].metadata as any) + .streamTools; let response: // | Awaited>> Awaited>>; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42c2387e7a..9c12f75d09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4122,6 +4122,9 @@ importers: '@ai-sdk/provider-utils': specifier: ^3.0.7 version: 3.0.7(zod@3.25.76) + '@ai-sdk/react': + specifier: ^2.0.39 + version: 2.0.39(react@19.1.0)(zod@3.25.76) '@blocknote/core': specifier: 0.35.0 version: link:../core @@ -4914,6 +4917,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 + '@ai-sdk/gateway@1.0.20': + resolution: {integrity: sha512-2K0kGnHyLfT1v2+3xXbLqohfWBJ/vmIh1FTWnrvZfvuUuBdOi2DMgnSQzkLvFVLyM8mhOcx+ZwU6IOOsuyOv/w==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4 + '@ai-sdk/google@2.0.11': resolution: {integrity: sha512-dnVIgSz1DZD/0gVau6ifYN3HZFN15HZwC9VjevTFfvrfSfbEvpXj5x/k/zk/0XuQrlQ5g8JiwJtxc9bx24x2xw==} engines: {node: '>=18'} @@ -4950,10 +4959,26 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 + '@ai-sdk/provider-utils@3.0.8': + resolution: {integrity: sha512-cDj1iigu7MW2tgAQeBzOiLhjHOUM9vENsgh4oAVitek0d//WdgfPCsKO3euP7m7LyO/j9a1vr/So+BGNdpFXYw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4 + '@ai-sdk/provider@2.0.0': resolution: {integrity: sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==} engines: {node: '>=18'} + '@ai-sdk/react@2.0.39': + resolution: {integrity: sha512-cBQZQG3ZtEebBPCcDVJGS4BU6e4ADgnO2PRhqvkPcPeFM68LK+x5E0VJcpLWUuoAW1Lv/yqy62LN3Ql1mFbzYQ==} + engines: {node: '>=18'} + peerDependencies: + react: ^18 || ^19 || ^19.0.0-rc + zod: ^3.25.76 || ^4 + peerDependenciesMeta: + zod: + optional: true + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -9906,6 +9931,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 + ai@5.0.39: + resolution: {integrity: sha512-1AOjTHY8MUY4T/X/I+otGTbvKmMQCCGWffuVDyQ21l/2Vv/QoLZcw+ZZHVvp+wvQcPOsfXjURGSFZtin7rnghA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4 + ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -14362,6 +14393,11 @@ packages: svg-arc-to-cubic-bezier@3.2.0: resolution: {integrity: sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==} + swr@2.3.6: + resolution: {integrity: sha512-wfHRmHWk/isGNMwlLGlZX5Gzz/uTgo0o2IRuTMcf4CPuPFJZlq0rDaKUx+ozB5nBOReNV1kiOyzMfj+MBMikLw==} + peerDependencies: + react: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -14441,6 +14477,10 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + throttleit@2.1.0: + resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==} + engines: {node: '>=18'} + tiny-inflate@1.0.3: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} @@ -15304,6 +15344,12 @@ snapshots: '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 + '@ai-sdk/gateway@1.0.20(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) + zod: 3.25.76 + '@ai-sdk/google@2.0.11(zod@3.25.76)': dependencies: '@ai-sdk/provider': 2.0.0 @@ -15341,10 +15387,27 @@ snapshots: eventsource-parser: 3.0.6 zod: 3.25.76 + '@ai-sdk/provider-utils@3.0.8(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 2.0.0 + '@standard-schema/spec': 1.0.0 + eventsource-parser: 3.0.6 + zod: 3.25.76 + '@ai-sdk/provider@2.0.0': dependencies: json-schema: 0.4.0 + '@ai-sdk/react@2.0.39(react@19.1.0)(zod@3.25.76)': + dependencies: + '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) + ai: 5.0.39(zod@3.25.76) + react: 19.1.0 + swr: 2.3.6(react@19.1.0) + throttleit: 2.1.0 + optionalDependencies: + zod: 3.25.76 + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -21126,6 +21189,14 @@ snapshots: '@opentelemetry/api': 1.9.0 zod: 3.25.76 + ai@5.0.39(zod@3.25.76): + dependencies: + '@ai-sdk/gateway': 1.0.20(zod@3.25.76) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) + '@opentelemetry/api': 1.9.0 + zod: 3.25.76 + ajv-formats@2.1.1(ajv@8.17.1): optionalDependencies: ajv: 8.17.1 @@ -26731,6 +26802,12 @@ snapshots: svg-arc-to-cubic-bezier@3.2.0: {} + swr@2.3.6(react@19.1.0): + dependencies: + dequal: 2.0.3 + react: 19.1.0 + use-sync-external-store: 1.5.0(react@19.1.0) + symbol-tree@3.2.4: {} system-architecture@0.1.0: {} @@ -26836,6 +26913,8 @@ snapshots: dependencies: any-promise: 1.3.0 + throttleit@2.1.0: {} + tiny-inflate@1.0.3: {} tiny-invariant@1.3.1: {} From a337d21e6c011ecbcb302648d161207e1d5aef00 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 10 Sep 2025 18:11:29 +0200 Subject: [PATCH 21/68] wip --- examples/09-ai/02-playground/src/App.tsx | 17 +- packages/xl-ai/src/AIExtension.ts | 165 ++++++-- packages/xl-ai/src/api/LLMRequest.ts | 37 +- .../xl-ai/src/api/formats/PromptBuilder.ts | 5 - .../src/streamTool/StreamToolExecutor.ts | 23 + packages/xl-ai/src/streamTool/asTool.ts | 31 +- .../vercelAiSdk/AISDKLLMRequestExecutor.ts | 5 +- .../clientside/ClientSideTransport.ts | 394 +++++++++--------- .../util/UIMessageStreamToOperationsResult.ts | 21 +- .../util/partialObjectStreamUtil.ts | 62 ++- 10 files changed, 449 insertions(+), 311 deletions(-) diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index 3b0bd0cd4e..d60363a1ae 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -24,7 +24,6 @@ import { AIToolbarButton, ClientSideTransport, createAIExtension, - createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAIExtension, getAISlashMenuItems, @@ -98,11 +97,9 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model, - stream, - }), + transport: new ClientSideTransport({ + model, + stream, }), }), ], @@ -139,11 +136,9 @@ export default function App() { // update the default model in the extension if (model !== "unknown-model") { ai.options.setState({ - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model, - stream, - }), + transport: new ClientSideTransport({ + model, + stream, }), }); } diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index a5f12cd134..f821b4a370 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -1,3 +1,4 @@ +import { Chat } from "@ai-sdk/react"; import { BlockNoteEditor, BlockNoteExtension, @@ -8,20 +9,29 @@ import { revertSuggestions, suggestChanges, } from "@blocknote/prosemirror-suggest-changes"; -import { APICallError, RetryError } from "ai"; +import { + APICallError, + ChatTransport, + DeepPartial, + RetryError, + UIMessage, +} from "ai"; import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { - doLLMRequest, - ExecuteLLMRequestOptions, - LLMRequestOptions, -} from "./api/LLMRequest.js"; -import { LLMResponse } from "./api/LLMResponse.js"; +import { LLMRequestOptions } from "./api/LLMRequest.js"; + +import { htmlBlockLLMFormat } from "./api/formats/html-blocks/htmlBlocks.js"; import { PromptBuilder } from "./api/formats/PromptBuilder.js"; import { LLMFormat, llmFormats } from "./api/index.js"; +import { LLMResponse } from "./api/LLMResponse.js"; +import { trimEmptyBlocks } from "./api/promptHelpers/trimEmptyBlocks.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; +import { StreamToolCall } from "./streamTool/streamTool.js"; +import { StreamToolExecutor } from "./streamTool/StreamToolExecutor.js"; +import { objectStreamToOperationsResult } from "./streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.js"; +import { isEmptyParagraph } from "./util/emptyBlock.js"; type MakeOptional = Omit & Partial>; @@ -55,10 +65,7 @@ type AIPluginState = { )) | "closed"; - /** - * The previous response from the LLM, used for multi-step LLM calls - */ - llmResponse?: LLMResponse; + chat?: Chat; }; /** @@ -82,7 +89,7 @@ type GlobalLLMRequestOptions = { * Implement this function if you want to call a backend that is not compatible with * the Vercel AI SDK */ - executor: (opts: ExecuteLLMRequestOptions) => Promise; + transport: ChatTransport; }; const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`); @@ -97,6 +104,7 @@ export class AIExtension extends BlockNoteExtension { // internal store including setters private readonly _store = createStore()((_set) => ({ aiMenuState: "closed", + chat: undefined, })); /** @@ -139,7 +147,6 @@ export class AIExtension extends BlockNoteExtension { MakeOptional, "promptBuilder"> >()((_set) => ({ dataFormat: llmFormats.html, - stream: true, ...options, })); @@ -190,7 +197,7 @@ export class AIExtension extends BlockNoteExtension { this.previousRequestOptions = undefined; this._store.setState({ aiMenuState: "closed", - llmResponse: undefined, + chat: undefined, }); this.editor.setForceSelectionVisible(false); this.editor.isEditable = true; @@ -350,26 +357,82 @@ export class AIExtension extends BlockNoteExtension { /** * Execute a call to an LLM and apply the result to the editor */ - public async callLLM(opts: MakeOptional) { + public async callLLM( + opts: LLMRequestOptions, + transport?: ChatTransport, + ) { this.setAIResponseStatus("thinking"); this.editor.forkYDocPlugin?.fork(); let ret: LLMResponse | undefined; try { - const requestOptions = { - ...this.options.getState(), + if (!this.store.getState().chat) { + this._store.setState({ + chat: new Chat({ + transport: transport || this.options.getState().transport, + }), + }); + } + const chat = this.store.getState().chat!; + + const { + dataFormat, + useSelection, + deleteEmptyCursorBlock, + userPrompt, + withDelays, + defaultStreamTools, + onBlockUpdate, + onStart, + ...rest + } = { + dataFormat: htmlBlockLLMFormat, + withDelays: true, ...opts, - previousResponse: this.store.getState().llmResponse, }; - this.previousRequestOptions = requestOptions; - ret = await doLLMRequest(this.editor, { - ...requestOptions, - onStart: () => { - this.setAIResponseStatus("ai-writing"); - opts.onStart?.(); - }, - onBlockUpdate: (blockId: string) => { + // ADD MESSAGES + + const promptBuilder = + opts.promptBuilder ?? dataFormat.defaultPromptBuilder; + + const cursorBlock = useSelection + ? undefined + : this.editor.getTextCursorPosition().block; + + const deleteCursorBlock: string | undefined = + cursorBlock && + deleteEmptyCursorBlock && + isEmptyParagraph(cursorBlock) && + trimEmptyBlocks(this.editor.document).length > 0 + ? cursorBlock.id + : undefined; + + const selectionInfo = useSelection + ? this.editor.getSelectionCutBlocks() + : undefined; + + const messages = await promptBuilder(this.editor, { + selectedBlocks: selectionInfo?.blocks, + userPrompt, + excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined, + }); + + chat.messages.push(...messages); + + // SEND MESSAGES + + const streamTools = dataFormat.getStreamTools( + this.editor, + withDelays, + defaultStreamTools, + selectionInfo + ? { + from: selectionInfo._meta.startPos, + to: selectionInfo._meta.endPos, + } + : undefined, + (blockId: string) => { // NOTE: does this setState with an anon object trigger unnecessary re-renders? this._store.setState({ aiMenuState: { @@ -377,15 +440,57 @@ export class AIExtension extends BlockNoteExtension { status: "ai-writing", }, }); - opts.onBlockUpdate?.(blockId); + onBlockUpdate?.(blockId); }, + ); + + const stream = new TransformStream< + DeepPartial<{ operations: StreamToolCall[] }> + >(); + + const operationsStream = objectStreamToOperationsResult( + stream.readable, + streamTools, + ); + + const writer = stream.writable.getWriter(); + const unsub = chat["~registerMessagesCallback"](() => { + // TODO: catch errors in this method + this.setAIResponseStatus("ai-writing"); + onStart?.(); + + const lastPart = + chat.lastMessage?.parts[chat.lastMessage.parts.length - 1]; + if (lastPart?.type === "tool-operations") { + if (lastPart.state === "input-streaming") { + const input = lastPart.input; + if (input !== undefined) { + writer.write(input as any); + } + } else if (lastPart.state === "input-available") { + const input = lastPart.input; + if (input === undefined) { + throw new Error("input is undefined"); + } + writer.write(input as any); + writer.close(); + unsub(); // TODO: also somewhere else? + } + } }); - this._store.setState({ - llmResponse: ret, + const executor = new StreamToolExecutor(streamTools); + // await executor.waitTillEnd(); + const executePromise = executor.execute(operationsStream); + + await chat.sendMessage(undefined, { + metadata: { + streamTools, + }, }); - await ret.execute(); + await executePromise; + // TODO: unsub this.setAIResponseStatus("user-reviewing"); } catch (e) { diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index 530927a0f0..cb7911165e 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,6 +1,5 @@ import { BlockNoteEditor } from "@blocknote/core"; import { UIMessage } from "ai"; -import { StreamTool } from "../streamTool/streamTool.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; import type { PromptBuilder } from "./formats/PromptBuilder.js"; @@ -10,32 +9,20 @@ import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; type MakeOptional = Omit & Partial>; -export type ExecuteLLMRequestOptions = { - messages: UIMessage[]; - streamTools: StreamTool[]; - // TODO: needed? - llmRequestOptions: MakeOptional; - onStart?: () => void; -}; +// export type ExecuteLLMRequestOptions = { +// messages: UIMessage[]; +// streamTools: StreamTool[]; +// // TODO: needed? +// llmRequestOptions: MakeOptional; +// onStart?: () => void; +// }; export type LLMRequestOptions = { - /** - * Customize how your LLM backend is called. - * Implement this function if you want to call a backend that is not compatible with - * the Vercel AI SDK - */ - executor: (opts: ExecuteLLMRequestOptions) => Promise; - /** * The user prompt to use for the LLM call */ userPrompt: string; - /** - * Previous response from the LLM, used for multi-step LLM calls - * - * (populated automatically when invoking `callLLM` via the `AIExtension` class) - */ - previousResponse?: LLMResponse; + /** * The default data format to use for LLM calls * "html" is recommended, the other formats are experimental @@ -211,6 +198,14 @@ export async function doLLMRequest( opts.onBlockUpdate, ); + // addMessages + + // + + // sendmessages + + // on chat result + // TODO: design decision, does it make sense to pass `messages` here, or should creating the message array // be the responsibility of the executor / server, and should we pass editor state instead? return opts.executor({ diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index 528a9e0a6b..6579185e68 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -29,11 +29,6 @@ export type PromptBuilderInput = { * this will be the id of the block that should be ignored) */ excludeBlockIds?: string[]; - /** - * When following a multi-step conversation, or repairing a previous error, - * the previous messages that have been sent to the LLM - */ - previousMessages?: Array; }; /** diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index b1a2496017..a7ee96fc47 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -3,6 +3,7 @@ import { asyncIterableToStream, createAsyncIterableStream, } from "../util/stream.js"; +import { filterNewOrUpdatedOperations } from "./filterNewOrUpdatedOperations.js"; import { StreamTool, StreamToolCall } from "./streamTool.js"; /** @@ -116,6 +117,28 @@ export class StreamToolExecutor[]> { return this.stream.writable; } + async executeOperationsArray(source: AsyncIterable) { + const writer = this.writable.getWriter(); + for await (const chunk of source) { + const parsed = await parsePartialJson(chunk); + + if ( + parsed.state === "undefined-input" || + parsed.state === "failed-parse" + ) { + return undefined; + } + + if (!parsed) { + return; + } + + filterNewOrUpdatedOperations; + await writer.write(chunk); + } + await writer.close(); + } + /** * Accepts an async iterable and writes each chunk to the internal stream. * diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts index 3f27ae2d36..6fb6fec697 100644 --- a/packages/xl-ai/src/streamTool/asTool.ts +++ b/packages/xl-ai/src/streamTool/asTool.ts @@ -15,10 +15,10 @@ export function streamToolAsTool>(streamTool: T) { return { success: true, value: result.value }; }, }), - execute: async (_value) => { - // console.log("execute", value); - // TODO - }, + // execute: async (_value) => { + // // console.log("execute", value); + // // TODO + // }, }); } @@ -26,19 +26,20 @@ export function streamToolsAsTool[]>(streamTools: T) { const schema = createStreamToolsArraySchema(streamTools); return tool({ + name: "operations", inputSchema: jsonSchema(schema, { - validate: (value) => { - const stream = operationsToStream(value); - if (!stream.ok) { - return { success: false, error: new Error(stream.error) }; - } - return { success: true, value: stream.value }; - }, + // validate: (value) => { + // const stream = operationsToStream(value); + // if (!stream.ok) { + // return { success: false, error: new Error(stream.error) }; + // } + // return { success: true, value: stream.value }; + // }, }), - execute: async (_value) => { - // TODO - // console.log("execute", value); - }, + // execute: async (_value) => { + // // TODO + // // console.log("execute", value); + // }, }); } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts index bd8b9b0d49..16bd53e4f5 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts @@ -35,12 +35,11 @@ export function createAISDKLLMRequestExecutor(opts: { chat["~registerMessagesCallback"](() => { console.log(chat.messages[chat.messages.length - 1]); + debugger; // process partial tool call here }); - await chat.sendMessage({ - role: "user", - parts: [{ type: "text", text: "do it" }], + await chat.sendMessage(undefined, { metadata: { streamTools: { add: { diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 55cfe7978b..c88562e1ad 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -5,189 +5,19 @@ import { UIMessageChunk, convertToModelMessages, generateObject, + generateText, jsonSchema, streamObject, streamText, } from "ai"; +import { streamToolsAsTool } from "../../asTool.js"; import { createStreamToolsArraySchema } from "../../jsonSchema.js"; import { StreamTool } from "../../streamTool.js"; import { - objectToUIMessageStream, - partialObjectStreamToUIMessageStream, + objectAsToolCallInUIMessageStream, + partialObjectStreamAsToolCallInUIMessageStream, } from "../util/partialObjectStreamUtil.js"; -type LLMRequestOptions = { - model: LanguageModel; - messages: UIMessage[]; - maxRetries: number; -}; - -/** - * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK. - * - * This is the non-streaming version. - */ -async function generateOperations[]>( - streamTools: T, - opts: LLMRequestOptions & { - _generateObjectOptions?: Partial>[0]>; - }, -) { - const { _generateObjectOptions, model, messages, ...rest } = opts; - - if (typeof model === "string") { - throw new Error("model must be a LanguageModelV2"); - } - - if ( - _generateObjectOptions && - ("output" in _generateObjectOptions || "schema" in _generateObjectOptions) - ) { - throw new Error( - "Cannot provide output or schema in _generateObjectOptions", - ); - } - - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); - const options = { - // non-overridable options for streamObject - output: "object" as const, - schema, - model, - // configurable options for streamObject - - // - optional, with defaults - - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - model.provider === "mistral.chat" || - model.provider === "google.generative-ai" - ? "auto" - : "tool", - messages: convertToModelMessages(messages), - providerOptions: - model.provider === "groq.chat" - ? { - groq: { - structuredOutputs: false, - }, - } - : {}, - - // - mandatory ones: - ...rest, - - // extra options for streamObject - ...((_generateObjectOptions ?? {}) as any), - } as const; - const ret = await generateObject(options); - - const stream = objectToUIMessageStream(ret.object); - - return { - uiMessageStream: stream, - /** - * Result of the underlying `generateObject` (AI SDK) call, or `undefined` if streaming mode - */ - generateObjectResult: ret, - }; -} - -/** - * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK. - * - * This is the streaming version. - */ -async function streamOperations[]>( - streamTools: T, - opts: LLMRequestOptions & { - _streamObjectOptions?: Partial< - Parameters>[0] - >; - }, -) { - const { _streamObjectOptions, model, messages, ...rest } = opts; - - if (typeof model === "string") { - throw new Error("model must be a LanguageModelV2"); - } - - if ( - _streamObjectOptions && - ("output" in _streamObjectOptions || "schema" in _streamObjectOptions) - ) { - throw new Error("Cannot provide output or schema in _streamObjectOptions"); - } - - // const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); - - const options = { - // non-overridable options for streamObject - output: "object" as const, - // schema, - model, - // configurable options for streamObject - - // - optional, with defaults - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - model.provider === "mistral.chat" || - model.provider === "google.generative-ai" - ? "auto" - : "tool", - // - mandatory ones: - messages: convertToModelMessages(messages), - providerOptions: - model.provider === "groq.chat" - ? { - groq: { - structuredOutputs: false, - }, - } - : {}, - ...rest, - - // extra options for streamObject - ...((opts._streamObjectOptions ?? {}) as any), - } as const; - - const ret2 = streamText({ - ...options, - tools: Object.fromEntries( - Object.entries(streamTools).map(([name, tool]) => [ - tool.name, - { - ...tool, - inputSchema: jsonSchema(tool.inputSchema), - }, - ]), - ), - }); - - return { - uiMessageStream: ret2.toUIMessageStream(), - }; - - const ret = streamObject(options); - - // Transform the partial object stream to a data stream format - const stream = partialObjectStreamToUIMessageStream(ret.fullStream); - - return { - uiMessageStream: stream, - /** - * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode - */ - streamObjectResult: ret, - }; -} - export class ClientSideTransport implements ChatTransport { @@ -206,63 +36,213 @@ export class ClientSideTransport /** * Whether to stream the LLM response or not * - * When streaming, we use the AI SDK `streamObject` function, - * otherwise, we use the AI SDK `generateObject` function. + * When streaming, we use the AI SDK stream functions `streamObject` / `streamText, + * otherwise, we use the AI SDK `generateObject` / `generateText` functions. * * @default true */ stream?: boolean; /** - * The maximum number of retries for the LLM call + * Use object generation instead of tool calling * - * @default 2 + * @default false */ - maxRetries?: number; + objectGeneration?: boolean; /** - * Additional options to pass to the AI SDK `generateObject` function - * (only used when `stream` is `false`) + * Additional options to pass to the AI SDK `generateObject` / `streamObject` / `streamText` / `generateText` functions */ - _generateObjectOptions?: Partial< - Parameters>[0] - >; - /** - * Additional options to pass to the AI SDK `streamObject` function - * (only used when `stream` is `true`) - */ - _streamObjectOptions?: Partial>[0]>; + _additionalOptions?: + | Partial[0]> + | Partial[0]> + | Partial[0]> + | Partial[0]>; }, ) {} + /** + * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK. + * + * This is the non-streaming version. + */ + protected async generateObject( + messages: UIMessage[], + streamTools: StreamTool[], + ) { + const { model, _additionalOptions } = this.opts; + + if (typeof model === "string") { + throw new Error("model must be a LanguageModelV2"); + } + + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + + const ret = await generateObject({ + // non-overridable options for streamObject + output: "object" as const, + schema, + model, + // configurable options for streamObject + + // - optional, with defaults + + // mistral somehow needs "auto", while groq/llama needs "tool" + // google needs "auto" because https://github.com/vercel/ai/issues/6959 + // TODO: further research this and / or make configurable + // for now stick to "tool" by default as this has been tested mostly + mode: + model.provider === "mistral.chat" || + model.provider === "google.generative-ai" + ? "auto" + : "tool", + messages: convertToModelMessages(messages), + providerOptions: + model.provider === "groq.chat" + ? { + groq: { + structuredOutputs: false, + }, + } + : {}, + // extra options for streamObject + ...((_additionalOptions ?? {}) as any), + }); + + return objectAsToolCallInUIMessageStream(ret.object, "add"); // TODO + } + + /** + * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK. + * + * This is the streaming version. + */ + protected async streamOperations( + messages: UIMessage[], + streamTools: StreamTool[], + ) { + const { model, _additionalOptions } = this.opts; + + if (typeof model === "string") { + throw new Error("model must be a LanguageModelV2"); + } + + const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + + const ret = streamObject({ + // non-overridable options for streamObject + output: "object" as const, + schema, + model, + // configurable options for streamObject + + // - optional, with defaults + // mistral somehow needs "auto", while groq/llama needs "tool" + // google needs "auto" because https://github.com/vercel/ai/issues/6959 + // TODO: further research this and / or make configurable + // for now stick to "tool" by default as this has been tested mostly + mode: + model.provider === "mistral.chat" || + model.provider === "google.generative-ai" + ? "auto" + : "tool", + // - mandatory ones: + messages: convertToModelMessages(messages), + providerOptions: + model.provider === "groq.chat" + ? { + groq: { + structuredOutputs: false, + }, + } + : {}, + // extra options for streamObject + ...((_additionalOptions ?? {}) as any), + }); + + // Transform the partial object stream to a data stream format + return partialObjectStreamAsToolCallInUIMessageStream( + ret.fullStream, + "add", // TODO + ); + } + + /** + * Calls an LLM with StreamTools, using the `streamText` of the AI SDK. + * + * This is the streaming version. + */ + protected async streamText[]>( + messages: UIMessage[], + streamTools: T, + ) { + const { model, _additionalOptions } = this.opts; + + const ret = streamText({ + model, + messages: convertToModelMessages(messages), + tools: { + operations: streamToolsAsTool(streamTools), + }, + // extra options for streamObject + ...((_additionalOptions ?? {}) as any), + }); + + return ret.toUIMessageStream(); + } + + /** + * // https://github.com/vercel/ai/issues/8380 + * + * Calls an LLM with StreamTools, using the `generateText` of the AI SDK. + * + * This is the streaming version. + */ + // protected async generateText[]>( + // messages: UIMessage[], + // streamTools: T, + // ) { + + // throw new Error("Not implemented"); + // // const { model, _additionalOptions, maxRetries } = this.opts; + + // // const ret = await generateText({ + // // model, + // // messages: convertToModelMessages(messages), + // // maxRetries, + // // tools: { + // // operations: streamToolsAsTool(streamTools), + // // }, + // // // extra options for streamObject + // // ...((_additionalOptions ?? {}) as any), + // // }); + + // // return createUIMessageStream(ret.response.messages); + // } + async sendMessages({ messages, body, + metadata, }: Parameters["sendMessages"]>[0]): Promise< ReadableStream > { - // const { streamTools } = body as { streamTools: StreamTool[] }; - const streamTools = (messages[messages.length - 1].metadata as any) - .streamTools; - let response: // | Awaited>> - Awaited>>; + const streamTools = (metadata as any).streamTools; + + if (this.opts.objectGeneration) { + if (this.opts.stream) { + return this.streamOperations(messages, streamTools); + } else { + return this.generateObject(messages, streamTools); + } + } if (this.opts.stream) { - response = await streamOperations(streamTools, { - messages, - model: this.opts.model, - maxRetries: this.opts.maxRetries, - ...(this.opts._streamObjectOptions as any), - }); + return this.streamText(messages, streamTools); } else { - response = (await generateOperations(streamTools, { - messages, - model: this.opts.model, - maxRetries: this.opts.maxRetries, - ...(this.opts._generateObjectOptions as any), - })) as any; + // https://github.com/vercel/ai/issues/8380 + throw new Error("Not implemented (generateText)"); } - return response.uiMessageStream; } reconnectToStream(): Promise | null> { diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts index 4412548075..73db02a40f 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -1,4 +1,4 @@ -import { UIMessageChunk } from "ai"; +import { DeepPartial, UIMessageChunk } from "ai"; import { OperationsResult } from "../../../api/LLMResponse.js"; import { createAsyncIterableStream, @@ -15,24 +15,33 @@ import { // stream vs generate, responsibility of backend // text vs object, -export async function UIMessageStreamToOperationsResult< - T extends StreamTool[], ->( +export function UIMessageStreamToOperationsResult[]>( stream: ReadableStream, streamTools: T, onStart: () => void = () => { // noop }, -): Promise> { +): OperationsResult { const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), ); + // Note: we can probably clean this up by switching to streams instead of async iterables + return objectStreamToOperationsResult(ret, streamTools, onStart); +} + +export function objectStreamToOperationsResult[]>( + stream: ReadableStream[] }>>, + streamTools: T, + onStart: () => void = () => { + // noop + }, +): OperationsResult { // Note: we can probably clean this up by switching to streams instead of async iterables return createAsyncIterableStreamFromAsyncIterable( preprocessOperationsStreaming( filterNewOrUpdatedOperations( - streamOnStartCallback(createAsyncIterableStream(ret), onStart), + streamOnStartCallback(createAsyncIterableStream(stream), onStart), ), streamTools, ), diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index 742aaa1d52..8f947507a8 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -28,16 +28,26 @@ import { */ // based on https://github.com/vercel/ai/blob/d8ada0eb81e42633172d739a40c88e6c5a2f426b/packages/react/src/use-object.ts#L202 -export function textStreamToPartialObjectStream() { +export function textStreamToPartialObjectStream( + opts: { + chunks: boolean; + } = { + chunks: true, + }, +) { let accumulatedText = ""; let latestObject: DeepPartial | undefined = undefined; return new TransformStream>({ transform: async (chunk, controller) => { accumulatedText += chunk; const { value } = await parsePartialJson(accumulatedText); - const currentObject = value as DeepPartial; - if (!isDeepEqualData(latestObject, currentObject)) { + const currentObject = value as DeepPartial | undefined; + + if ( + currentObject !== undefined && + !isDeepEqualData(latestObject, currentObject) + ) { latestObject = currentObject; controller.enqueue(currentObject); @@ -90,23 +100,31 @@ export function uiMessageStreamObjectDataToTextStream( * Based on: https://github.com/vercel/ai/blob/b2469681bd31635a33a4b233d889f122c0b432c9/packages/ai/src/ui/transform-text-to-ui-message-stream.ts#L3 * */ -export function partialObjectStreamToUIMessageStream( +export function partialObjectStreamAsToolCallInUIMessageStream( stream: ReadableStream>, + toolName: string, ): ReadableStream { + let accumulatedString = ""; return stream.pipeThrough( new TransformStream({ start(controller) { controller.enqueue({ type: "start" }); controller.enqueue({ type: "start-step" }); + controller.enqueue({ + type: "tool-input-start", + toolCallId: "call_object_1", + toolName, + }); // controller.enqueue({ type: "text-start", id: "text-1" }); }, transform(chunk, controller) { switch (chunk.type) { case "text-delta": + accumulatedString += chunk.textDelta; controller.enqueue({ - type: "data-object-delta", - id: "text-1", - data: chunk.textDelta, + type: "tool-input-delta", + toolCallId: "call_object_1", + inputTextDelta: chunk.textDelta, }); break; case "object": @@ -126,6 +144,12 @@ export function partialObjectStreamToUIMessageStream( }, async flush(controller) { // controller.enqueue({ type: "text-end", id: "text-1" }); + controller.enqueue({ + type: "tool-input-available", + toolCallId: "call_object_1", + toolName, + input: JSON.parse(accumulatedString), + }); controller.enqueue({ type: "finish-step" }); controller.enqueue({ type: "finish" }); }, @@ -134,18 +158,30 @@ export function partialObjectStreamToUIMessageStream( } // convert a plain object to a UIMessageStream. -export function objectToUIMessageStream(object: any) { +export function objectAsToolCallInUIMessageStream( + object: any, + toolName: string, +) { const stream = new ReadableStream({ start(controller) { controller.enqueue({ type: "start" }); controller.enqueue({ type: "start-step" }); - // controller.enqueue({ type: "data-object-start", id: "text-1" }); controller.enqueue({ - type: "data-object-delta", - id: "text-1", - data: JSON.stringify(object), + type: "tool-input-start", + toolCallId: "call_object_1", + toolName, + }); + controller.enqueue({ + type: "tool-input-delta", + toolCallId: "call_object_1", + inputTextDelta: JSON.stringify(object), + }); + controller.enqueue({ + type: "tool-input-available", + toolCallId: "call_object_1", + toolName, + input: object, }); - // controller.enqueue({ type: "text-end", id: "text-1" }); controller.enqueue({ type: "finish-step" }); controller.enqueue({ type: "finish" }); controller.close(); From db8f96bacbf69da31004edce7e394b5dae583505 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 16 Sep 2025 10:09:04 +0200 Subject: [PATCH 22/68] wip --- packages/xl-ai/src/AIExtension.ts | 242 ++++++++---------- packages/xl-ai/src/api/LLMRequest.ts | 72 +++--- .../xl-ai/src/api/formats/PromptBuilder.ts | 26 +- .../html-blocks/defaultHTMLPromptBuilder.ts | 181 +------------ .../src/api/formats/html-blocks/htmlBlocks.ts | 22 +- .../api/formats/html-blocks/htmlPromptData.ts | 37 +++ packages/xl-ai/src/api/index.ts | 19 +- .../src/streamTool/StreamToolExecutor.ts | 2 - .../util/UIMessageStreamToOperationsResult.ts | 26 +- .../vercelAiSdk/util/chatHandlers.ts | 160 ++++++++++++ 10 files changed, 407 insertions(+), 380 deletions(-) create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index f821b4a370..2471f0f6f1 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -9,32 +9,30 @@ import { revertSuggestions, suggestChanges, } from "@blocknote/prosemirror-suggest-changes"; -import { - APICallError, - ChatTransport, - DeepPartial, - RetryError, - UIMessage, -} from "ai"; +import { APICallError, RetryError, UIMessage } from "ai"; import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { LLMRequestOptions } from "./api/LLMRequest.js"; +import { LLMRequestHelpers, LLMRequestOptions } from "./api/LLMRequest.js"; +import { defaultHTMLPromptBuilder } from "./api/formats/html-blocks/defaultHTMLPromptBuilder.js"; import { htmlBlockLLMFormat } from "./api/formats/html-blocks/htmlBlocks.js"; -import { PromptBuilder } from "./api/formats/PromptBuilder.js"; -import { LLMFormat, llmFormats } from "./api/index.js"; +import { + defaultHTMLPromptDataBuilder, + HTMLPromptData, +} from "./api/formats/html-blocks/htmlPromptData.js"; +import { + BlockNoteUserPrompt, + PromptBuilder, + PromptInputDataBuilder, +} from "./api/formats/PromptBuilder.js"; import { LLMResponse } from "./api/LLMResponse.js"; import { trimEmptyBlocks } from "./api/promptHelpers/trimEmptyBlocks.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; -import { StreamToolCall } from "./streamTool/streamTool.js"; -import { StreamToolExecutor } from "./streamTool/StreamToolExecutor.js"; -import { objectStreamToOperationsResult } from "./streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.js"; +import { setupToolCallStreaming } from "./streamTool/vercelAiSdk/util/chatHandlers.js"; import { isEmptyParagraph } from "./util/emptyBlock.js"; -type MakeOptional = Omit & Partial>; - type ReadonlyStoreApi = Pick< StoreApi, "getState" | "getInitialState" | "subscribe" @@ -68,35 +66,9 @@ type AIPluginState = { chat?: Chat; }; -/** - * configuration options for LLM calls that are shared across all calls by default - */ -type GlobalLLMRequestOptions = { - /** - * The default data format to use for LLM calls - * html format is recommended, the other formats are experimental - * @default llmFormats.html - */ - dataFormat?: LLMFormat; - /** - * A function that can be used to customize the prompt sent to the LLM - * @default the default prompt builder for the selected {@link dataFormat} - */ - promptBuilder?: PromptBuilder; - - /** - * Customize how your LLM backend is called. - * Implement this function if you want to call a backend that is not compatible with - * the Vercel AI SDK - */ - transport: ChatTransport; -}; - const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`); export class AIExtension extends BlockNoteExtension { - private previousRequestOptions: LLMRequestOptions | undefined; - public static key(): string { return "ai"; } @@ -120,11 +92,7 @@ export class AIExtension extends BlockNoteExtension { * These options are used by default across all LLM calls when calling {@link doLLMRequest} */ public readonly options: ReturnType< - ReturnType< - typeof createStore< - MakeOptional, "promptBuilder"> - > - > + ReturnType> >; /** @@ -132,7 +100,7 @@ export class AIExtension extends BlockNoteExtension { */ constructor( public readonly editor: BlockNoteEditor, - options: GlobalLLMRequestOptions & { + options: LLMRequestHelpers & { /** * The name and color of the agent cursor * @@ -143,10 +111,7 @@ export class AIExtension extends BlockNoteExtension { ) { super(); - this.options = createStore< - MakeOptional, "promptBuilder"> - >()((_set) => ({ - dataFormat: llmFormats.html, + this.options = createStore()((_set) => ({ ...options, })); @@ -194,7 +159,6 @@ export class AIExtension extends BlockNoteExtension { * Close the AI menu */ public closeAIMenu() { - this.previousRequestOptions = undefined; this._store.setState({ aiMenuState: "closed", chat: undefined, @@ -202,6 +166,7 @@ export class AIExtension extends BlockNoteExtension { this.editor.setForceSelectionVisible(false); this.editor.isEditable = true; this.editor.focus(); + // TODO: clear chat? } /** @@ -279,18 +244,23 @@ export class AIExtension extends BlockNoteExtension { const state = this.store.getState().aiMenuState; if ( state === "closed" || - state.status !== "error" || - !this.previousRequestOptions + state.status !== "error" + // !this.previousRequestOptions TODO ) { throw new Error("retry() is only valid when a previous response failed"); } + debugger; if ( state.error instanceof APICallError || state.error instanceof RetryError ) { + // TODO // retry the previous call as-is, as there was a network error - return this.callLLM(this.previousRequestOptions); + // return this.callLLM(); + throw new Error("retry() is not implemented"); } else { + // TODO + // an error occurred while parsing / executing the previous LLM call // give the LLM a chance to fix the error // (Possible improvement: maybe this should be a system prompt instead of the userPrompt) @@ -298,11 +268,11 @@ export class AIExtension extends BlockNoteExtension { state.error instanceof Error ? state.error.message : String(state.error); - - return this.callLLM({ - userPrompt: `An error occured: ${errorMessage} - Please retry the previous user request.`, - }); + throw new Error("retry() is not implemented"); + // return this.callLLM({ + // userPrompt: `An error occured: ${errorMessage} + // Please retry the previous user request.`, + // }); } } @@ -354,53 +324,71 @@ export class AIExtension extends BlockNoteExtension { } } + // move executor + // tool call results + // errors + // TODO: retries + /** * Execute a call to an LLM and apply the result to the editor */ - public async callLLM( - opts: LLMRequestOptions, - transport?: ChatTransport, - ) { + public async callLLM(opts: LLMRequestOptions) { this.setAIResponseStatus("thinking"); this.editor.forkYDocPlugin?.fork(); let ret: LLMResponse | undefined; try { if (!this.store.getState().chat) { + // TODO: what if transport changes? this._store.setState({ chat: new Chat({ - transport: transport || this.options.getState().transport, + sendAutomaticallyWhen: () => false, + transport: opts.transport || this.options.getState().transport, }), }); } const chat = this.store.getState().chat!; + const globalOpts = this.options.getState(); const { - dataFormat, + // TODO: how to pass extra metadata / body + userPrompt, useSelection, deleteEmptyCursorBlock, - userPrompt, - withDelays, - defaultStreamTools, - onBlockUpdate, - onStart, + streamToolsProvider, + + promptBuilder, + + transport, ...rest } = { - dataFormat: htmlBlockLLMFormat, - withDelays: true, + deleteEmptyCursorBlock: true, // default true + ...globalOpts, ...opts, }; - // ADD MESSAGES + let { messageSender } = { + ...rest, + }; + + if (messageSender && promptBuilder) { + throw new Error( + "messageSender and promptBuilder cannot be used together", + ); + } - const promptBuilder = - opts.promptBuilder ?? dataFormat.defaultPromptBuilder; + if (!messageSender) { + messageSender = promptMessageSender( + promptBuilder ?? defaultHTMLPromptBuilder, + defaultHTMLPromptDataBuilder, + ); + } const cursorBlock = useSelection ? undefined : this.editor.getTextCursorPosition().block; - const deleteCursorBlock: string | undefined = + const emptyCursorBlockToDelete: string | undefined = cursorBlock && deleteEmptyCursorBlock && isEmptyParagraph(cursorBlock) && @@ -412,26 +400,18 @@ export class AIExtension extends BlockNoteExtension { ? this.editor.getSelectionCutBlocks() : undefined; - const messages = await promptBuilder(this.editor, { - selectedBlocks: selectionInfo?.blocks, - userPrompt, - excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined, - }); - - chat.messages.push(...messages); - - // SEND MESSAGES - - const streamTools = dataFormat.getStreamTools( + // TODO, works with retry? + const streamTools = ( + streamToolsProvider ?? htmlBlockLLMFormat.getStreamToolsProvider() + ).getStreamTools( this.editor, - withDelays, - defaultStreamTools, selectionInfo ? { from: selectionInfo._meta.startPos, to: selectionInfo._meta.endPos, } : undefined, + // TODO: remove? (blockId: string) => { // NOTE: does this setState with an anon object trigger unnecessary re-renders? this._store.setState({ @@ -440,57 +420,30 @@ export class AIExtension extends BlockNoteExtension { status: "ai-writing", }, }); - onBlockUpdate?.(blockId); }, ); - const stream = new TransformStream< - DeepPartial<{ operations: StreamToolCall[] }> - >(); - - const operationsStream = objectStreamToOperationsResult( - stream.readable, - streamTools, - ); - - const writer = stream.writable.getWriter(); - const unsub = chat["~registerMessagesCallback"](() => { - // TODO: catch errors in this method + const executePromise = setupToolCallStreaming(streamTools, chat, () => { this.setAIResponseStatus("ai-writing"); - onStart?.(); - - const lastPart = - chat.lastMessage?.parts[chat.lastMessage.parts.length - 1]; - if (lastPart?.type === "tool-operations") { - if (lastPart.state === "input-streaming") { - const input = lastPart.input; - if (input !== undefined) { - writer.write(input as any); - } - } else if (lastPart.state === "input-available") { - const input = lastPart.input; - if (input === undefined) { - throw new Error("input is undefined"); - } - writer.write(input as any); - writer.close(); - unsub(); // TODO: also somewhere else? - } + if (emptyCursorBlockToDelete) { + this.editor.removeBlocks([emptyCursorBlockToDelete]); } }); - const executor = new StreamToolExecutor(streamTools); - // await executor.waitTillEnd(); - const executePromise = executor.execute(operationsStream); - - await chat.sendMessage(undefined, { - metadata: { + await messageSender.sendMessage({ + editor: this.editor, + chat, + blockNoteUserPrompt: { + userPrompt, + selectedBlocks: selectionInfo?.blocks, streamTools, + emptyCursorBlockToDelete, }, }); + // TODO: what if no tool calls were made? + // TODO: add tool result? await executePromise; - // TODO: unsub this.setAIResponseStatus("user-reviewing"); } catch (e) { @@ -524,3 +477,34 @@ export function createAIExtension( export function getAIExtension(editor: BlockNoteEditor) { return editor.extension(AIExtension); } + +export type MessageSender = { + sendMessage: (opts: { + editor: BlockNoteEditor; + chat: Chat; + blockNoteUserPrompt: BlockNoteUserPrompt; + }) => Promise; +}; + +function promptMessageSender( + promptBuilder: PromptBuilder, + promptInputDataBuilder: PromptInputDataBuilder, +): MessageSender { + return { + async sendMessage(opts) { + const promptData = await promptInputDataBuilder( + opts.editor, + opts.blockNoteUserPrompt, + ); + + opts.chat.messages = await promptBuilder(promptData); + + // TBD: call sendMessage? + return opts.chat.sendMessage(undefined, { + metadata: { + streamTools: opts.blockNoteUserPrompt.streamTools, + }, + }); + }, + }; +} diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index cb7911165e..3c9fe50237 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,10 +1,12 @@ import { BlockNoteEditor } from "@blocknote/core"; -import { UIMessage } from "ai"; +import { ChatTransport, UIMessage } from "ai"; +import { MessageSender } from "../AIExtension.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; import { LLMResponse } from "./LLMResponse.js"; import type { PromptBuilder } from "./formats/PromptBuilder.js"; import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; -import { LLMFormat } from "./index.js"; +import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; +import { StreamToolsProvider } from "./index.js"; import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; type MakeOptional = Omit & Partial>; @@ -17,46 +19,48 @@ type MakeOptional = Omit & Partial>; // onStart?: () => void; // }; +export type LLMRequestHelpers = { + /** + * Customize how your LLM backend is called. + * Implement this function if you want to call a backend that is not compatible with + * the Vercel AI SDK + */ + transport?: ChatTransport; + + streamToolsProvider?: StreamToolsProvider; +} & ( + | { + /** + * The `PromptBuilder` to use for the LLM call + * + * (A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's prompt + * and turns it into an AI SDK `CoreMessage` array to be passed to the LLM) + * + * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) + */ + promptBuilder?: PromptBuilder; + + messageSender?: never; + } + | { + // messageSender variant + promptBuilder?: never; + messageSender?: MessageSender; + } +); + export type LLMRequestOptions = { /** * The user prompt to use for the LLM call */ userPrompt: string; - /** - * The default data format to use for LLM calls - * "html" is recommended, the other formats are experimental - * @default html format (`llm.html`) - */ - dataFormat?: LLMFormat; - /** - * The `PromptBuilder` to use for the LLM call - * - * (A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's prompt - * and turns it into an AI SDK `CoreMessage` array to be passed to the LLM) - * - * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) - */ - promptBuilder?: PromptBuilder; /** * Whether to use the editor selection for the LLM call * * @default true */ useSelection?: boolean; - /** - * Defines whether the LLM can add, update, or delete blocks - * - * @default { add: true, update: true, delete: true } - */ - defaultStreamTools?: { - /** Enable the add tool (default: false) */ - add?: boolean; - /** Enable the update tool (default: false) */ - update?: boolean; - /** Enable the delete tool (default: false) */ - delete?: boolean; - }; /** * If the user's cursor is in an empty paragraph, automatically delete it when the AI * is starting to write. @@ -76,13 +80,7 @@ export type LLMRequestOptions = { * Callback when the AI Agent starts writing */ onStart?: () => void; - /** - * Whether to add delays between text update operations, to make the AI simulate a human typing - * - * @default true - */ - withDelays?: boolean; -}; +} & LLMRequestHelpers; /** * Execute an LLM call diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index 6579185e68..be55b378f4 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -1,5 +1,6 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; import { UIMessage } from "ai"; +import { StreamTool } from "../../streamTool/streamTool.js"; /* We want users to be able to easily customize the prompts send to an LLM, @@ -11,10 +12,7 @@ Every format (html, markdown, json) has a default PromptBuilder that is used if which is also exposed as `llm.html.defaultPromptBuilder` etc. for possible reuse. */ -/** - * The input passed to a PromptBuilder - */ -export type PromptBuilderInput = { +export type BlockNoteUserPrompt = { /** * The user's prompt */ @@ -24,18 +22,24 @@ export type PromptBuilderInput = { */ selectedBlocks?: Block[]; /** - * The ids of blocks that should be excluded from the prompt - * (e.g.: if `deleteEmptyCursorBlock` is true in the LLMRequest, - * this will be the id of the block that should be ignored) + * The id of the block that should be excluded from the LLM call, + * this is used when using the AI slash menu in an empty block + */ + emptyCursorBlockToDelete?: string; + + /** + * The stream tools that can be used by the LLM */ - excludeBlockIds?: string[]; + streamTools: StreamTool[]; }; /** * A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's promot * and turns it into an array of CoreMessage (AI SDK) to be passed to the LLM. */ -export type PromptBuilder = ( +export type PromptBuilder = (inputData: E) => Promise>; + +export type PromptInputDataBuilder = ( editor: BlockNoteEditor, - opts: PromptBuilderInput, -) => Promise>; + blockNoteUserPrompt: BlockNoteUserPrompt, +) => Promise; diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index 46f9f69147..0d627b798b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -1,22 +1,10 @@ import { UIMessage } from "ai"; -import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import type { PromptBuilder } from "../PromptBuilder.js"; -import { - getDataForPromptNoSelection, - getDataForPromptWithSelection, -} from "./htmlPromptData.js"; +import { HTMLPromptData } from "./htmlPromptData.js"; -function promptManipulateSelectionHTMLBlocks(opts: { - userPrompt: string; - htmlSelectedBlocks: { - id: string; - block: string; - }[]; - htmlDocument: { - block: string; - }[]; - isEmptyDocument: boolean; -}): Array { +function promptManipulateSelectionHTMLBlocks( + opts: Exclude, +): Array { return [ { role: "system", @@ -78,19 +66,9 @@ function promptManipulateSelectionHTMLBlocks(opts: { ]; } -function promptManipulateDocumentUseHTMLBlocks(opts: { - userPrompt: string; - htmlBlocks: Array< - | { - id: string; - block: string; - } - | { - cursor: true; - } - >; - isEmptyDocument: boolean; -}): Array { +function promptManipulateDocumentUseHTMLBlocks( + opts: Exclude, +): Array { return [ { role: "system", @@ -158,145 +136,12 @@ function promptManipulateDocumentUseHTMLBlocks(opts: { ]; } -export const defaultHTMLPromptBuilder: PromptBuilder = async (editor, opts) => { - const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; - - if (opts.selectedBlocks) { - const data = await getDataForPromptWithSelection(editor, { - selectedBlocks: opts.selectedBlocks, - }); - - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "html-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated selection. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "html-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.htmlSelectedBlocks), - }, - ], - }, - { - role: "system", - id: "html-previous-response-document", - parts: [ - { - type: "text", - text: "This is the updated entire document:", - }, - ], - }, - { - role: "system", - id: "html-previous-response-document-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.htmlDocument), - }, - ], - }, - { - role: "system", - id: "html-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "html-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateSelectionHTMLBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); +export const defaultHTMLPromptBuilder: PromptBuilder = async ( + inputData, +) => { + if (inputData.selection) { + return promptManipulateSelectionHTMLBlocks(inputData); } else { - const data = await getDataForPromptNoSelection(editor, opts); - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "html-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated document. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "html-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.htmlBlocks), - }, - ], - }, - { - role: "system", - id: "html-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "html-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateDocumentUseHTMLBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); + return promptManipulateDocumentUseHTMLBlocks(inputData); } }; diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index bf78be57b7..bb4ecd1280 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -77,12 +77,32 @@ export const htmlBlockLLMFormat = { /** * Function to get the stream tools that can apply HTML block updates to the editor */ - getStreamTools, + getStreamToolsProvider: ( + opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, + ) => ({ + getStreamTools: ( + editor: BlockNoteEditor, + selectionInfo?: { from: number; to: number }, + onBlockUpdate?: (blockId: string) => void, + ) => { + return getStreamTools( + editor, + opts.withDelays || true, + opts.defaultStreamTools, + selectionInfo, + onBlockUpdate, + ); + }, + }), + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) */ defaultPromptBuilder: defaultHTMLPromptBuilder, + + defaultPromptInputDataBuilder: getDataForPromptNoSelection, + /** * Helper functions which can be used when implementing a custom PromptBuilder */ diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts index aeceedd84b..78fc67b109 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts @@ -4,6 +4,37 @@ import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; import { suffixIDs } from "../../promptHelpers/suffixIds.js"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; +import { BlockNoteUserPrompt } from "../PromptBuilder.js"; + +export type HTMLPromptData = ( + | Awaited> + | Awaited> +) & { + userPrompt: string; +}; + +export async function defaultHTMLPromptDataBuilder( + editor: BlockNoteEditor, + blockNoteUserPrompt: BlockNoteUserPrompt, +) { + if (blockNoteUserPrompt.selectedBlocks) { + return { + ...(await getDataForPromptWithSelection(editor, { + selectedBlocks: blockNoteUserPrompt.selectedBlocks, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } else { + return { + ...(await getDataForPromptNoSelection(editor, { + excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete + ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + : undefined, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } +} export async function getDataForPromptNoSelection( editor: BlockNoteEditor, @@ -11,6 +42,7 @@ export async function getDataForPromptNoSelection( excludeBlockIds?: string[]; }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const cursorBlockId = editor.getTextCursorPosition().block.id; const input = trimEmptyBlocks(editor.document, { cursorBlockId, @@ -27,7 +59,9 @@ export async function getDataForPromptNoSelection( ); const suffixed = suffixIDs(filtered); return { + selection: false as const, htmlBlocks: suffixed, + isEmptyDocument, }; } @@ -37,6 +71,7 @@ export async function getDataForPromptWithSelection( selectedBlocks: Block[]; }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const blockArray = await convertBlocks( flattenBlocks(opts.selectedBlocks), async (block) => { @@ -46,6 +81,8 @@ export async function getDataForPromptWithSelection( const suffixed = suffixIDs(blockArray); return { + isEmptyDocument, + selection: true as const, htmlSelectedBlocks: suffixed, htmlDocument: ( await convertBlocks(flattenBlocks(editor.document), async (block) => { diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 9a84127930..6f339e095c 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -5,24 +5,27 @@ import { jsonLLMFormat } from "./formats/json/json.js"; import { markdownBlocksLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js"; import { PromptBuilder } from "./formats/PromptBuilder.js"; +export type StreamToolsProvider = { + getStreamTools: ( + editor: BlockNoteEditor, + selectionInfo?: { + from: number; + to: number; + }, + ) => StreamTool[]; +}; export type LLMFormat = { /** * Function to get the stream tools that can apply HTML block updates to the editor */ - getStreamTools: ( - editor: BlockNoteEditor, + getStreamToolsProvider: ( withDelays: boolean, defaultStreamTools?: { add?: boolean; update?: boolean; delete?: boolean; }, - selectionInfo?: { - from: number; - to: number; - }, - onBlockUpdate?: (blockId: string) => void, - ) => StreamTool[]; + ) => StreamToolsProvider; /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index a7ee96fc47..5e50569492 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -3,7 +3,6 @@ import { asyncIterableToStream, createAsyncIterableStream, } from "../util/stream.js"; -import { filterNewOrUpdatedOperations } from "./filterNewOrUpdatedOperations.js"; import { StreamTool, StreamToolCall } from "./streamTool.js"; /** @@ -133,7 +132,6 @@ export class StreamToolExecutor[]> { return; } - filterNewOrUpdatedOperations; await writer.write(chunk); } await writer.close(); diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts index 73db02a40f..19bbdb377b 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -18,46 +18,24 @@ import { export function UIMessageStreamToOperationsResult[]>( stream: ReadableStream, streamTools: T, - onStart: () => void = () => { - // noop - }, ): OperationsResult { const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), ); // Note: we can probably clean this up by switching to streams instead of async iterables - return objectStreamToOperationsResult(ret, streamTools, onStart); + return objectStreamToOperationsResult(ret, streamTools); } export function objectStreamToOperationsResult[]>( stream: ReadableStream[] }>>, streamTools: T, - onStart: () => void = () => { - // noop - }, ): OperationsResult { // Note: we can probably clean this up by switching to streams instead of async iterables return createAsyncIterableStreamFromAsyncIterable( preprocessOperationsStreaming( - filterNewOrUpdatedOperations( - streamOnStartCallback(createAsyncIterableStream(stream), onStart), - ), + filterNewOrUpdatedOperations(createAsyncIterableStream(stream)), streamTools, ), ); } - -async function* streamOnStartCallback( - stream: AsyncIterable, - onStart: () => void, -): AsyncIterable { - let first = true; - for await (const chunk of stream) { - if (first) { - onStart(); - first = false; - } - yield chunk; - } -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts new file mode 100644 index 0000000000..91c4a85acf --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -0,0 +1,160 @@ +import { Chat } from "@ai-sdk/react"; +import { DeepPartial, isToolUIPart, UIMessage } from "ai"; +import { StreamTool, StreamToolCall } from "../../streamTool.js"; +import { StreamToolExecutor } from "../../StreamToolExecutor.js"; +import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsResult.js"; + +// Types for tool call streaming +type ToolCallStreamData = { + stream: TransformStream[] }>>; + writer: WritableStreamDefaultWriter< + DeepPartial<{ operations: StreamToolCall[] }> + >; + complete: boolean; +}; + +/** + * Process tool call parts and manage individual streams per toolCallId + */ +function processToolCallParts( + chat: Chat, + toolCallStreams: Map, + mergedResultsWriter: WritableStreamDefaultWriter, + streamTools: StreamTool[], +) { + for (const part of chat.lastMessage?.parts ?? []) { + if (!isToolUIPart(part)) { + continue; + } + + const toolCallId = part.toolCallId; + + // Create a new complete pipeline for this toolCallId if it doesn't exist + if (!toolCallStreams.has(toolCallId)) { + const toolCallData = createToolCallStream( + mergedResultsWriter, + streamTools, + ); + toolCallStreams.set(toolCallId, toolCallData); + } + + const toolCallData = toolCallStreams.get(toolCallId)!; + processToolCallPart(part, toolCallData); + } +} + +/** + * Create a complete stream pipeline for a single toolCallId + */ +function createToolCallStream( + mergedResultsWriter: WritableStreamDefaultWriter, + streamTools: StreamTool[], +): ToolCallStreamData { + const stream = new TransformStream< + DeepPartial<{ operations: StreamToolCall[] }> + >(); + const operationsStream = objectStreamToOperationsResult( + stream.readable, + streamTools, + ); + const writer = stream.writable.getWriter(); + + // Write operations results directly to the merged results writer + operationsStream.pipeTo( + new WritableStream({ + write(chunk) { + mergedResultsWriter.write(chunk); + }, + close() { + // Don't close the merged results writer here - it will be closed when all tool calls are done + }, + }), + ); + + return { + stream, + writer, + complete: false, + }; +} + +/** + * Process a single tool call part (streaming or available) + */ +function processToolCallPart(part: any, toolCallData: ToolCallStreamData) { + if (part.state === "input-streaming") { + const input = part.input; + if (input !== undefined) { + toolCallData.writer.write(input as any); + } + } else if (part.state === "input-available") { + const input = part.input; + if (input === undefined) { + throw new Error("input is undefined"); + } + if (!toolCallData.complete) { + toolCallData.complete = true; + toolCallData.writer.write(input as any); + console.log("processToolCallPart close", part.toolCallId, input); + toolCallData.writer.close(); + } + } +} + +/** + * Set up tool call streaming infrastructure with individual streams per toolCallId + * and merged results processing + */ +export async function setupToolCallStreaming( + streamTools: StreamTool[], + chat: Chat, + onStart: () => void, +) { + const executor = new StreamToolExecutor(streamTools); + const toolCallStreams = new Map(); + + let first = true; + const mergedResultsStream = new TransformStream({ + transform: (chunk, controller) => { + if (first) { + onStart(); + first = false; + } + controller.enqueue(chunk); + }, + }); + const mergedResultsStreamWritable = mergedResultsStream.writable; + const mergedResultsWriter = mergedResultsStreamWritable.getWriter(); + + mergedResultsStream.readable.pipeTo(executor.writable); + + const unsub = chat["~registerMessagesCallback"](() => { + console.log("messagesCallback", chat.lastMessage); + processToolCallParts( + chat, + toolCallStreams, + mergedResultsWriter, + streamTools, + ); + }); + + const statusHandler = new Promise((resolve, reject) => { + const unsub2 = chat["~registerStatusCallback"](() => { + if (chat.status === "ready" || chat.status === "error") { + console.log("statusHandler close", chat.status); + mergedResultsWriter.close(); + unsub(); + unsub2(); + + if (chat.status === "ready") { + resolve(); + } else { + reject(chat.status); + } + } + }); + }); + + await statusHandler; + await executor.waitTillEnd(); +} From d1a495f55e369ca74e9f7ee03969986ad2654fe3 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 16 Sep 2025 13:00:45 +0200 Subject: [PATCH 23/68] wip --- packages/xl-ai/src/AIExtension.ts | 2 - .../xl-ai/src/blocknoteAIClient/client.ts | 12 +- .../vercelAiSdk/util/chatHandlers.ts | 113 +++++++++--------- 3 files changed, 61 insertions(+), 66 deletions(-) diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 2471f0f6f1..203231f302 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -324,7 +324,6 @@ export class AIExtension extends BlockNoteExtension { } } - // move executor // tool call results // errors // TODO: retries @@ -442,7 +441,6 @@ export class AIExtension extends BlockNoteExtension { }); // TODO: what if no tool calls were made? - // TODO: add tool result? await executePromise; this.setAIResponseStatus("user-reviewing"); diff --git a/packages/xl-ai/src/blocknoteAIClient/client.ts b/packages/xl-ai/src/blocknoteAIClient/client.ts index c64137972e..2ddeceb3c2 100644 --- a/packages/xl-ai/src/blocknoteAIClient/client.ts +++ b/packages/xl-ai/src/blocknoteAIClient/client.ts @@ -20,15 +20,9 @@ const fetchViaBlockNoteAIServer = duplex: "half", } as any, ); - try { - const resp = await fetch(newRequest); - return resp; - } catch (e) { - // Temp fix for https://github.com/vercel/ai/issues/6370 - throw new TypeError("fetch failed", { - cause: e, - }); - } + + const resp = await fetch(newRequest); + return resp; }; /** diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 91c4a85acf..7a1f1e0e93 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -11,6 +11,7 @@ type ToolCallStreamData = { DeepPartial<{ operations: StreamToolCall[] }> >; complete: boolean; + executor: StreamToolExecutor; }; /** @@ -18,9 +19,10 @@ type ToolCallStreamData = { */ function processToolCallParts( chat: Chat, - toolCallStreams: Map, - mergedResultsWriter: WritableStreamDefaultWriter, - streamTools: StreamTool[], + getToolCallStreamData: (data: { + toolName: string; + toolCallId: string; + }) => ToolCallStreamData, ) { for (const part of chat.lastMessage?.parts ?? []) { if (!isToolUIPart(part)) { @@ -29,16 +31,11 @@ function processToolCallParts( const toolCallId = part.toolCallId; - // Create a new complete pipeline for this toolCallId if it doesn't exist - if (!toolCallStreams.has(toolCallId)) { - const toolCallData = createToolCallStream( - mergedResultsWriter, - streamTools, - ); - toolCallStreams.set(toolCallId, toolCallData); - } + const toolCallData = getToolCallStreamData({ + toolName: part.type.replace("tool-", ""), + toolCallId, + }); - const toolCallData = toolCallStreams.get(toolCallId)!; processToolCallPart(part, toolCallData); } } @@ -47,7 +44,6 @@ function processToolCallParts( * Create a complete stream pipeline for a single toolCallId */ function createToolCallStream( - mergedResultsWriter: WritableStreamDefaultWriter, streamTools: StreamTool[], ): ToolCallStreamData { const stream = new TransformStream< @@ -59,22 +55,16 @@ function createToolCallStream( ); const writer = stream.writable.getWriter(); - // Write operations results directly to the merged results writer - operationsStream.pipeTo( - new WritableStream({ - write(chunk) { - mergedResultsWriter.write(chunk); - }, - close() { - // Don't close the merged results writer here - it will be closed when all tool calls are done - }, - }), - ); + const executor = new StreamToolExecutor(streamTools); + + // Pipe operations directly into this tool call's executor + operationsStream.pipeTo(executor.writable); return { stream, writer, complete: false, + executor, }; } @@ -95,7 +85,6 @@ function processToolCallPart(part: any, toolCallData: ToolCallStreamData) { if (!toolCallData.complete) { toolCallData.complete = true; toolCallData.writer.write(input as any); - console.log("processToolCallPart close", part.toolCallId, input); toolCallData.writer.close(); } } @@ -110,51 +99,65 @@ export async function setupToolCallStreaming( chat: Chat, onStart: () => void, ) { - const executor = new StreamToolExecutor(streamTools); const toolCallStreams = new Map(); - let first = true; - const mergedResultsStream = new TransformStream({ - transform: (chunk, controller) => { - if (first) { - onStart(); - first = false; - } - controller.enqueue(chunk); - }, - }); - const mergedResultsStreamWritable = mergedResultsStream.writable; - const mergedResultsWriter = mergedResultsStreamWritable.getWriter(); + const executePromises: Promise[] = []; - mergedResultsStream.readable.pipeTo(executor.writable); + let first = true; const unsub = chat["~registerMessagesCallback"](() => { - console.log("messagesCallback", chat.lastMessage); - processToolCallParts( - chat, - toolCallStreams, - mergedResultsWriter, - streamTools, - ); + processToolCallParts(chat, (data) => { + if (!toolCallStreams.has(data.toolCallId)) { + const toolCallStreamData = createToolCallStream(streamTools); + toolCallStreams.set(data.toolCallId, toolCallStreamData); + if (first) { + first = false; + onStart(); + } + executePromises.push( + toolCallStreamData.executor.waitTillEnd().then( + () => { + chat.addToolResult({ + tool: data.toolName, + toolCallId: data.toolCallId, + output: { status: "ok" }, + }); + }, + (error) => { + chat.addToolResult({ + tool: data.toolName, + toolCallId: data.toolCallId, + output: { status: "error", error: error.message }, + }); + }, + ), + ); + } + return toolCallStreams.get(data.toolCallId)!; + }); }); const statusHandler = new Promise((resolve, reject) => { const unsub2 = chat["~registerStatusCallback"](() => { - if (chat.status === "ready" || chat.status === "error") { - console.log("statusHandler close", chat.status); - mergedResultsWriter.close(); + if (chat.status === "ready") { unsub(); unsub2(); + unsub3(); + resolve(); + } + }); - if (chat.status === "ready") { - resolve(); - } else { - reject(chat.status); - } + const unsub3 = chat["~registerErrorCallback"](() => { + if (chat.error) { + unsub(); + unsub2(); + unsub3(); + reject(chat.error); } }); }); await statusHandler; - await executor.waitTillEnd(); + + await Promise.all(executePromises); } From ddb9b62063e7807c4bfe4562e70c563d4c05ecac Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 16 Sep 2025 13:05:12 +0200 Subject: [PATCH 24/68] remove --- packages/xl-ai/src/AIExtension.ts | 3 - packages/xl-ai/src/api/LLMRequest.ts | 152 ------------------ packages/xl-ai/src/api/LLMResponse.ts | 80 --------- .../vercelAiSdk/AISDKLLMRequestExecutor.ts | 77 --------- .../util/UIMessageStreamToOperationsResult.ts | 41 ----- 5 files changed, 353 deletions(-) delete mode 100644 packages/xl-ai/src/api/LLMResponse.ts delete mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts delete mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 203231f302..5f23bbd81b 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -27,7 +27,6 @@ import { PromptBuilder, PromptInputDataBuilder, } from "./api/formats/PromptBuilder.js"; -import { LLMResponse } from "./api/LLMResponse.js"; import { trimEmptyBlocks } from "./api/promptHelpers/trimEmptyBlocks.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; import { setupToolCallStreaming } from "./streamTool/vercelAiSdk/util/chatHandlers.js"; @@ -335,7 +334,6 @@ export class AIExtension extends BlockNoteExtension { this.setAIResponseStatus("thinking"); this.editor.forkYDocPlugin?.fork(); - let ret: LLMResponse | undefined; try { if (!this.store.getState().chat) { // TODO: what if transport changes? @@ -454,7 +452,6 @@ export class AIExtension extends BlockNoteExtension { // eslint-disable-next-line no-console console.warn("Error calling LLM", e); } - return ret; } } diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index 3c9fe50237..f620c83293 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -1,13 +1,8 @@ -import { BlockNoteEditor } from "@blocknote/core"; import { ChatTransport, UIMessage } from "ai"; import { MessageSender } from "../AIExtension.js"; -import { isEmptyParagraph } from "../util/emptyBlock.js"; -import { LLMResponse } from "./LLMResponse.js"; import type { PromptBuilder } from "./formats/PromptBuilder.js"; -import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; import { StreamToolsProvider } from "./index.js"; -import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; type MakeOptional = Omit & Partial>; @@ -70,151 +65,4 @@ export type LLMRequestOptions = { * @default true */ deleteEmptyCursorBlock?: boolean; - /** - * Callback when a specific block is updated by the LLM - * - * (used by `AIExtension` to update the `AIMenu` position) - */ - onBlockUpdate?: (blockId: string) => void; - /** - * Callback when the AI Agent starts writing - */ - onStart?: () => void; } & LLMRequestHelpers; - -/** - * Execute an LLM call - * - * @param editor - The BlockNoteEditor the LLM should operate on - * @param opts - The options for the LLM call (@link {CallLLMOptions}) - * @returns A `LLMResponse` object containing the LLM response which can be applied to the editor - */ -export async function doLLMRequest( - editor: BlockNoteEditor, - opts: LLMRequestOptions, -): Promise { - const { - userPrompt, - useSelection, - deleteEmptyCursorBlock, - onStart, - withDelays, - dataFormat, - previousResponse, - } = { - deleteEmptyCursorBlock: true, - withDelays: true, - dataFormat: htmlBlockLLMFormat, - ...opts, - }; - - const promptBuilder = opts.promptBuilder ?? dataFormat.defaultPromptBuilder; - const getStreamTools = dataFormat.getStreamTools; - - const cursorBlock = useSelection - ? undefined - : editor.getTextCursorPosition().block; - - const deleteCursorBlock: string | undefined = - cursorBlock && - deleteEmptyCursorBlock && - isEmptyParagraph(cursorBlock) && - trimEmptyBlocks(editor.document).length > 0 - ? cursorBlock.id - : undefined; - - const selectionInfo = useSelection - ? editor.getSelectionCutBlocks() - : undefined; - - let previousMessages: UIMessage[] | undefined = undefined; - - if (previousResponse) { - previousMessages = previousResponse.messages.map((m) => { - // Some models, like Gemini and Anthropic don't support mixing system and user messages. - // Therefore, we convert all user messages to system messages. - // (also see comment below on a possibly better approach that might also address this) - if (m.role === "user") { - return { - id: m.id, - role: "system", - parts: m.parts.map((part) => { - if (part.type === "text") { - return { type: "text", text: `USER_MESSAGE: ${part.text}` }; - } - - throw new Error(`Unexpected part type: ${part.type}`); - }), - }; - } - - return m; - }); - /* - We currently insert these messages as "assistant" string messages. - When using Tools, the "official" pattern for this is to use a "tool_result" message. - We might need to switch to this, but it would require more research whether: - - we maybe should switch to streamText / generateText instead of streamObject / generateObject - (this has built in access to `response.messages` on the AI SDK level) - - but, we need to make research whether tool calls are always way to go. - generateObject / streamObject can also use structured outputs, and this - might be yielding better results than tool calls. - - For now, this approach works ok. - */ - // TODO: fix - // previousMessages.push({ - // id: "previous-response-message", - // role: "system", // using "assistant" here doesn't work with gemini because we can't mix system / assistant messages - // parts: [ - // { - // type: "text", - // text: - // "ASSISTANT_MESSAGE: These are the operations returned by a previous LLM call: \n" + - // JSON.stringify( - // await previousResponse.llmResult.getGeneratedOperations(), - // ), - // }, - // ], - // }); - } - - const messages = await promptBuilder(editor, { - selectedBlocks: selectionInfo?.blocks, - userPrompt, - excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined, - previousMessages, - }); - - const streamTools = getStreamTools( - editor, - withDelays, - opts.defaultStreamTools, - selectionInfo - ? { from: selectionInfo._meta.startPos, to: selectionInfo._meta.endPos } - : undefined, - opts.onBlockUpdate, - ); - - // addMessages - - // - - // sendmessages - - // on chat result - - // TODO: design decision, does it make sense to pass `messages` here, or should creating the message array - // be the responsibility of the executor / server, and should we pass editor state instead? - return opts.executor({ - onStart: () => { - if (deleteCursorBlock) { - editor.removeBlocks([deleteCursorBlock]); - } - onStart?.(); - }, - messages, - streamTools, - llmRequestOptions: opts, - }); -} diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts deleted file mode 100644 index 10ace37cc3..0000000000 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { UIMessage } from "ai"; -import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; -import { StreamToolExecutor } from "../streamTool/StreamToolExecutor.js"; -import { AsyncIterableStream } from "../util/stream.js"; - -/** - * Result of an LLM call with stream tools - */ -export type OperationsResult[]> = - AsyncIterableStream<{ - /** - * The operation the LLM wants to execute - */ - operation: StreamToolCall; - /** - * Whether {@link operation} is an update to the previous operation in the stream. - * - * For non-streaming mode, this will always be `false` - */ - isUpdateToPreviousOperation: boolean; - /** - * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) - * - * For non-streaming mode, this will always be `false` - */ - isPossiblyPartial: boolean; - }>; - -/** - * Result of an LLM call with stream tools that apply changes to a BlockNote Editor - * - * TODO: maybe get rid of this class? - */ -export class LLMResponse { - /** - * @internal - */ - constructor( - /** - * The messages sent to the LLM - */ - public readonly messages: UIMessage[], - /** - * Result of the underlying LLM call. Use this to access operations the LLM decided to execute, but without applying them. - * (usually this is only used for advanced used cases or debugging) - */ - public readonly llmResult: OperationsResult, - - private readonly streamTools: StreamTool[], - ) {} - - /** - * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results. - * - * (this method consumes underlying streams in `llmResult`) - */ - public async execute() { - const executor = new StreamToolExecutor(this.streamTools); - await executor.execute(this.llmResult); - await executor.waitTillEnd(); - } - - /** - * @internal - * - * TODO - */ - public async _logToolCalls() { - for await (const toolCall of this.llmResult) { - // eslint-disable-next-line no-console - console.log(JSON.stringify(toolCall, null, 2)); - } - } -} - -// TODO -// async getGeneratedOperations() { -// return { operations }; -// }, -// } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts deleted file mode 100644 index 16bd53e4f5..0000000000 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/AISDKLLMRequestExecutor.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Chat } from "@ai-sdk/react"; -import { ChatTransport, UIMessage } from "ai"; -import { ExecuteLLMRequestOptions } from "../../api/LLMRequest.js"; -import { LLMResponse } from "../../api/LLMResponse.js"; - -/** - * Creates a LLMRequestExecutor based on a AI SDK Transport - */ -export function createAISDKLLMRequestExecutor(opts: { - /** - * The transport to use for the LLM call - */ - transport: ChatTransport; -}) { - const { transport } = opts; - return async (opts: ExecuteLLMRequestOptions) => { - const { messages, streamTools, onStart } = opts; - - const chat = new Chat({ - transport, - messages, - onData: (data) => { - console.log("onData"); - console.log(data); - }, - onToolCall: (toolCall) => { - console.log("onToolCall"); - console.log(toolCall); - }, - onError: (error) => { - console.log("onError"); - console.log(error); - }, - }); - - chat["~registerMessagesCallback"](() => { - console.log(chat.messages[chat.messages.length - 1]); - debugger; - // process partial tool call here - }); - - await chat.sendMessage(undefined, { - metadata: { - streamTools: { - add: { - name: "add", - inputSchema: streamTools[0].inputSchema, - description: streamTools[0].description, - }, - }, - }, - }); - - return new LLMResponse(chat.messages, undefined as any, streamTools); - - // TODO: add support for streamText / generateText and tool calls - - // const response = await transport.sendMessages({ - // messages, - // trigger: "submit-message", - // chatId: "1", - // messageId: undefined, - // abortSignal: undefined, - // body: { - // streamTools, - // }, - // }); - - // // TODO: needed here or move outside? - // const parsedResponse = await UIMessageStreamToOperationsResult( - // response, - // streamTools, - // onStart, - // ); - // return new LLMResponse(messages, parsedResponse, streamTools); - }; -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts deleted file mode 100644 index 19bbdb377b..0000000000 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { DeepPartial, UIMessageChunk } from "ai"; -import { OperationsResult } from "../../../api/LLMResponse.js"; -import { - createAsyncIterableStream, - createAsyncIterableStreamFromAsyncIterable, -} from "../../../util/stream.js"; -import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations.js"; -import { preprocessOperationsStreaming } from "../../preprocess.js"; -import { StreamTool, StreamToolCall } from "../../streamTool.js"; -import { - textStreamToPartialObjectStream, - uiMessageStreamObjectDataToTextStream, -} from "./partialObjectStreamUtil.js"; - -// stream vs generate, responsibility of backend -// text vs object, - -export function UIMessageStreamToOperationsResult[]>( - stream: ReadableStream, - streamTools: T, -): OperationsResult { - const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( - textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), - ); - - // Note: we can probably clean this up by switching to streams instead of async iterables - return objectStreamToOperationsResult(ret, streamTools); -} - -export function objectStreamToOperationsResult[]>( - stream: ReadableStream[] }>>, - streamTools: T, -): OperationsResult { - // Note: we can probably clean this up by switching to streams instead of async iterables - return createAsyncIterableStreamFromAsyncIterable( - preprocessOperationsStreaming( - filterNewOrUpdatedOperations(createAsyncIterableStream(stream)), - streamTools, - ), - ); -} From 85b84764c1aa37e0586af701995499a50708c0dd Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 16 Sep 2025 13:12:37 +0200 Subject: [PATCH 25/68] fix --- packages/xl-ai/src/api/LLMResponse.ts | 25 +++++++++++ .../util/UIMessageStreamToOperationsResult.ts | 41 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 packages/xl-ai/src/api/LLMResponse.ts create mode 100644 packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts new file mode 100644 index 0000000000..03638050e5 --- /dev/null +++ b/packages/xl-ai/src/api/LLMResponse.ts @@ -0,0 +1,25 @@ +import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; +import { AsyncIterableStream } from "../util/stream.js"; + +/** + * Result of an LLM call with stream tools + */ +export type OperationsResult[]> = + AsyncIterableStream<{ + /** + * The operation the LLM wants to execute + */ + operation: StreamToolCall; + /** + * Whether {@link operation} is an update to the previous operation in the stream. + * + * For non-streaming mode, this will always be `false` + */ + isUpdateToPreviousOperation: boolean; + /** + * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) + * + * For non-streaming mode, this will always be `false` + */ + isPossiblyPartial: boolean; + }>; diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts new file mode 100644 index 0000000000..19bbdb377b --- /dev/null +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -0,0 +1,41 @@ +import { DeepPartial, UIMessageChunk } from "ai"; +import { OperationsResult } from "../../../api/LLMResponse.js"; +import { + createAsyncIterableStream, + createAsyncIterableStreamFromAsyncIterable, +} from "../../../util/stream.js"; +import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations.js"; +import { preprocessOperationsStreaming } from "../../preprocess.js"; +import { StreamTool, StreamToolCall } from "../../streamTool.js"; +import { + textStreamToPartialObjectStream, + uiMessageStreamObjectDataToTextStream, +} from "./partialObjectStreamUtil.js"; + +// stream vs generate, responsibility of backend +// text vs object, + +export function UIMessageStreamToOperationsResult[]>( + stream: ReadableStream, + streamTools: T, +): OperationsResult { + const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( + textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), + ); + + // Note: we can probably clean this up by switching to streams instead of async iterables + return objectStreamToOperationsResult(ret, streamTools); +} + +export function objectStreamToOperationsResult[]>( + stream: ReadableStream[] }>>, + streamTools: T, +): OperationsResult { + // Note: we can probably clean this up by switching to streams instead of async iterables + return createAsyncIterableStreamFromAsyncIterable( + preprocessOperationsStreaming( + filterNewOrUpdatedOperations(createAsyncIterableStream(stream)), + streamTools, + ), + ); +} From 82f6b8018b75ea4350857875d3b37e93720f98a5 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 08:43:57 +0200 Subject: [PATCH 26/68] wip --- examples/09-ai/01-minimal/src/App.tsx | 7 +- .../09-ai/03-custom-ai-menu-items/src/App.tsx | 7 +- .../09-ai/04-with-collaboration/src/App.tsx | 7 +- .../09-ai/06-server-execution/src/App.tsx | 10 +- packages/xl-ai/src/AIExtension.ts | 47 ++++------ .../xl-ai/src/api/formats/PromptBuilder.ts | 5 +- .../html-blocks/defaultHTMLPromptBuilder.ts | 93 +++++++++++++++++-- .../formats/html-blocks/htmlBlocks.test.ts | 12 +-- packages/xl-ai/src/api/index.ts | 4 +- packages/xl-ai/src/index.ts | 2 +- .../vercelAiSdk/util/chatHandlers.ts | 37 ++++++-- 11 files changed, 156 insertions(+), 75 deletions(-) diff --git a/examples/09-ai/01-minimal/src/App.tsx b/examples/09-ai/01-minimal/src/App.tsx index 2e5945cd34..63d0c51f5b 100644 --- a/examples/09-ai/01-minimal/src/App.tsx +++ b/examples/09-ai/01-minimal/src/App.tsx @@ -17,7 +17,6 @@ import { AIToolbarButton, ClientSideTransport, createAIExtension, - createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; @@ -67,10 +66,8 @@ export default function App() { extensions: [ // TODO: too many layers of indirection? createAIExtension({ - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model, - }), + transport: new ClientSideTransport({ + model, }), }), ], diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index 4910b70a9f..0bc8b95c29 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -18,7 +18,6 @@ import { AIToolbarButton, ClientSideTransport, createAIExtension, - createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, getDefaultAIMenuItems, @@ -69,10 +68,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model, - }), + transport: new ClientSideTransport({ + model, }), }), ], diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index 6a4d529402..d15c879f60 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -17,7 +17,6 @@ import { AIToolbarButton, ClientSideTransport, createAIExtension, - createAISDKLLMRequestExecutor, createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; @@ -111,10 +110,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model, - }), + transport: new ClientSideTransport({ + model, }), }), ], diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx index d7ba5cf519..8e7c211449 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -15,7 +15,6 @@ import { AIMenuController, AIToolbarButton, createAIExtension, - createAISDKLLMRequestExecutor, getAISlashMenuItems, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; @@ -40,11 +39,10 @@ export default function App() { // We define a custom executor that calls our backend server to execute LLM calls // On the backend, we use the Vercel AI SDK to execute LLM calls // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) - executor: createAISDKLLMRequestExecutor({ - transport: new DefaultChatTransport({ - // Can also use /generateObject for non-streaming mode - api: `${BASE_URL}/streamObject`, - }), + + transport: new DefaultChatTransport({ + // Can also use /generateObject for non-streaming mode + api: `${BASE_URL}/streamObject`, }), }), ], diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 5f23bbd81b..5ce9727f6a 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -9,7 +9,7 @@ import { revertSuggestions, suggestChanges, } from "@blocknote/prosemirror-suggest-changes"; -import { APICallError, RetryError, UIMessage } from "ai"; +import { UIMessage } from "ai"; import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; @@ -165,7 +165,6 @@ export class AIExtension extends BlockNoteExtension { this.editor.setForceSelectionVisible(false); this.editor.isEditable = true; this.editor.focus(); - // TODO: clear chat? } /** @@ -240,38 +239,29 @@ export class AIExtension extends BlockNoteExtension { * Only valid if the current status is "error" */ public async retry() { - const state = this.store.getState().aiMenuState; + const { aiMenuState, chat } = this.store.getState(); if ( - state === "closed" || - state.status !== "error" + aiMenuState === "closed" || + aiMenuState.status !== "error" // !this.previousRequestOptions TODO ) { throw new Error("retry() is only valid when a previous response failed"); } - debugger; - if ( - state.error instanceof APICallError || - state.error instanceof RetryError - ) { - // TODO - // retry the previous call as-is, as there was a network error - // return this.callLLM(); - throw new Error("retry() is not implemented"); - } else { - // TODO + if (!chat) { + throw new Error("chat not found in retry()"); + } + + if (chat?.status === "error") { + // the LLM call failed (i.e. a network error) + chat.regenerate(); + } else { // an error occurred while parsing / executing the previous LLM call // give the LLM a chance to fix the error - // (Possible improvement: maybe this should be a system prompt instead of the userPrompt) - const errorMessage = - state.error instanceof Error - ? state.error.message - : String(state.error); - throw new Error("retry() is not implemented"); - // return this.callLLM({ - // userPrompt: `An error occured: ${errorMessage} - // Please retry the previous user request.`, - // }); + + return this.callLLM({ + userPrompt: `An error occured in the previous tool call. Please retry.`, + }); } } @@ -337,6 +327,7 @@ export class AIExtension extends BlockNoteExtension { try { if (!this.store.getState().chat) { // TODO: what if transport changes? + console.log("new chat"); this._store.setState({ chat: new Chat({ sendAutomaticallyWhen: () => false, @@ -445,6 +436,7 @@ export class AIExtension extends BlockNoteExtension { } catch (e) { // TODO in error state, should we discard the forked document? + debugger; this.setAIResponseStatus({ status: "error", error: e, @@ -492,9 +484,8 @@ function promptMessageSender( opts.blockNoteUserPrompt, ); - opts.chat.messages = await promptBuilder(promptData); + await promptBuilder(opts.chat.messages, promptData); - // TBD: call sendMessage? return opts.chat.sendMessage(undefined, { metadata: { streamTools: opts.blockNoteUserPrompt.streamTools, diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index be55b378f4..201dfd3433 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -37,7 +37,10 @@ export type BlockNoteUserPrompt = { * A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's promot * and turns it into an array of CoreMessage (AI SDK) to be passed to the LLM. */ -export type PromptBuilder = (inputData: E) => Promise>; +export type PromptBuilder = ( + messages: UIMessage[], + inputData: E, +) => Promise; export type PromptInputDataBuilder = ( editor: BlockNoteEditor, diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index 0d627b798b..027b896aa1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -3,9 +3,51 @@ import type { PromptBuilder } from "../PromptBuilder.js"; import { HTMLPromptData } from "./htmlPromptData.js"; function promptManipulateSelectionHTMLBlocks( + messages: UIMessage[], opts: Exclude, -): Array { - return [ +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "html-selected-blocks-json-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):`, + }, + { + type: "text", + text: JSON.stringify(opts.htmlSelectedBlocks), + }, + { + type: "text", + text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.htmlDocument), + }, + ], + }, + { + role: "user", + id: "html-user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + } + + messages.push( { role: "system", id: "html-selected-blocks", @@ -63,13 +105,47 @@ function promptManipulateSelectionHTMLBlocks( }, ], }, - ]; + ); } function promptManipulateDocumentUseHTMLBlocks( + messages: UIMessage[], opts: Exclude, -): Array { - return [ +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "html-document-json-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`, + }, + { + type: "text", + text: JSON.stringify(opts.htmlBlocks), + }, + ], + }, + { + role: "user", + id: "html-user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + return; + } + messages.push( { role: "system", id: "html-document", @@ -133,15 +209,16 @@ function promptManipulateDocumentUseHTMLBlocks( }, ], }, - ]; + ); } export const defaultHTMLPromptBuilder: PromptBuilder = async ( + messages, inputData, ) => { if (inputData.selection) { - return promptManipulateSelectionHTMLBlocks(inputData); + promptManipulateSelectionHTMLBlocks(messages, inputData); } else { - return promptManipulateDocumentUseHTMLBlocks(inputData); + promptManipulateDocumentUseHTMLBlocks(messages, inputData); } }; diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index c6e0d4772d..623e8cb6bc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -3,7 +3,6 @@ import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; import { doLLMRequest } from "../../LLMRequest.js"; @@ -129,12 +128,11 @@ describe("Models", () => { ...options, dataFormat: htmlBlockLLMFormat, withDelays: false, - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model: params.model, - maxRetries: 0, - stream: params.stream, - }), + + transport: new ClientSideTransport({ + model: params.model, + maxRetries: 0, + stream: params.stream, }), }), // TODO: remove when matthew's parsing PR is merged diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 6f339e095c..8dfab6a786 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -44,6 +44,6 @@ export const llmFormats = { html: htmlBlockLLMFormat, }; -export { doLLMRequest as callLLM } from "./LLMRequest.js"; -export { LLMResponse } from "./LLMResponse.js"; +// export { doLLMRequest as callLLM } from "./LLMRequest.js"; +// export { LLMResponse } from "./LLMResponse.js"; export { promptHelpers } from "./promptHelpers/index.js"; diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts index 856eda8cfb..ba069f66a3 100644 --- a/packages/xl-ai/src/index.ts +++ b/packages/xl-ai/src/index.ts @@ -17,7 +17,7 @@ export * from "./api/index.js"; // TODO: organize these exports: export * from "./streamTool/jsonSchema.js"; export * from "./streamTool/StreamToolExecutor.js"; -export * from "./streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; + export * from "./streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; export * from "./streamTool/vercelAiSdk/util/partialObjectStreamUtil.js"; export * from "./streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.js"; diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 7a1f1e0e93..c7c95a9bf8 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -1,3 +1,4 @@ +import { getErrorMessage } from "@ai-sdk/provider-utils"; import { Chat } from "@ai-sdk/react"; import { DeepPartial, isToolUIPart, UIMessage } from "ai"; import { StreamTool, StreamToolCall } from "../../streamTool.js"; @@ -124,10 +125,12 @@ export async function setupToolCallStreaming( }); }, (error) => { + // TODO: in a later version of the sdk, make sure we set output-error if possible? + // (currently no such method seems to be exposed) chat.addToolResult({ tool: data.toolName, toolCallId: data.toolCallId, - output: { status: "error", error: error.message }, + output: { status: "error", error: getErrorMessage(error) }, }); }, ), @@ -137,27 +140,47 @@ export async function setupToolCallStreaming( }); }); - const statusHandler = new Promise((resolve, reject) => { + const statusHandler = new Promise((resolve) => { const unsub2 = chat["~registerStatusCallback"](() => { - if (chat.status === "ready") { + if (chat.status === "ready" || chat.status === "error") { unsub(); unsub2(); - unsub3(); + if (chat.status !== "error") { + // don't unsubscribe the error listener if chat.status === "error" + // we need to wait for the error event, because only in the error event we can read chat.error + // (in this status listener, it's still undefined) + unsub3(); + } resolve(); } }); const unsub3 = chat["~registerErrorCallback"](() => { if (chat.error) { - unsub(); - unsub2(); unsub3(); - reject(chat.error); + for (const data of toolCallStreams.values()) { + if (!data.complete) { + data.writer.abort(chat.error); + } + } + // reject(chat.error); + // we intentionally commented out the above line to not reject here + // instead, we abort (raise an error) in the unfinished tool calls } }); }); + // wait until all messages have been received await statusHandler; + // let all stream executors finish, this can take longer due to artificial delays + // (e.g. to simulate human typing behaviour) await Promise.all(executePromises); + + if (chat.error) { + // if there was an error, it's likely we already throwed it in the line above, + // however, theoretically there could be an error (e.g.: network error) in a message part after the last tool call + // in this case we still need to throw here + throw chat.error; + } } From 6f7df30c381881c5cfad5bed8611debd55d11c9e Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 14:10:30 +0200 Subject: [PATCH 27/68] wip --- packages/xl-ai/src/AIExtension.ts | 138 +++++++----------- packages/xl-ai/src/api/LLMRequest.ts | 68 --------- packages/xl-ai/src/api/LLMResponse.ts | 25 ---- .../xl-ai/src/api/formats/PromptBuilder.ts | 52 +++---- .../formats/html-blocks/htmlBlocks.test.ts | 2 +- .../api/formats/json/errorHandling.test.ts | 2 +- .../xl-ai/src/api/formats/json/json.test.ts | 2 +- .../markdown-blocks/markdownBlocks.test.ts | 2 +- .../src/api/formats/promptAIRequestSender.ts | 32 ++++ packages/xl-ai/src/api/index.ts | 3 +- .../util/UIMessageStreamToOperationsResult.ts | 25 +++- .../vercelAiSdk/util/chatHandlers.ts | 8 + packages/xl-ai/src/types.ts | 136 +++++++++++++++++ 13 files changed, 279 insertions(+), 216 deletions(-) delete mode 100644 packages/xl-ai/src/api/LLMRequest.ts delete mode 100644 packages/xl-ai/src/api/LLMResponse.ts create mode 100644 packages/xl-ai/src/api/formats/promptAIRequestSender.ts create mode 100644 packages/xl-ai/src/types.ts diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 5ce9727f6a..19ba881c3c 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -14,22 +14,14 @@ import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { LLMRequestHelpers, LLMRequestOptions } from "./api/LLMRequest.js"; - import { defaultHTMLPromptBuilder } from "./api/formats/html-blocks/defaultHTMLPromptBuilder.js"; import { htmlBlockLLMFormat } from "./api/formats/html-blocks/htmlBlocks.js"; -import { - defaultHTMLPromptDataBuilder, - HTMLPromptData, -} from "./api/formats/html-blocks/htmlPromptData.js"; -import { - BlockNoteUserPrompt, - PromptBuilder, - PromptInputDataBuilder, -} from "./api/formats/PromptBuilder.js"; +import { defaultHTMLPromptDataBuilder } from "./api/formats/html-blocks/htmlPromptData.js"; +import { promptAIRequestSender } from "./api/formats/promptAIRequestSender.js"; import { trimEmptyBlocks } from "./api/promptHelpers/trimEmptyBlocks.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; import { setupToolCallStreaming } from "./streamTool/vercelAiSdk/util/chatHandlers.js"; +import { LLMRequestHelpers, LLMRequestOptions } from "./types.js"; import { isEmptyParagraph } from "./util/emptyBlock.js"; type ReadonlyStoreApi = Pick< @@ -61,13 +53,18 @@ type AIPluginState = { } )) | "closed"; - - chat?: Chat; }; const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`); export class AIExtension extends BlockNoteExtension { + private chatSession: + | { + previousRequestOptions: LLMRequestOptions; + chat: Chat; + } + | undefined; + public static key(): string { return "ai"; } @@ -75,7 +72,6 @@ export class AIExtension extends BlockNoteExtension { // internal store including setters private readonly _store = createStore()((_set) => ({ aiMenuState: "closed", - chat: undefined, })); /** @@ -160,8 +156,8 @@ export class AIExtension extends BlockNoteExtension { public closeAIMenu() { this._store.setState({ aiMenuState: "closed", - chat: undefined, }); + this.chatSession = undefined; this.editor.setForceSelectionVisible(false); this.editor.isEditable = true; this.editor.focus(); @@ -239,28 +235,38 @@ export class AIExtension extends BlockNoteExtension { * Only valid if the current status is "error" */ public async retry() { - const { aiMenuState, chat } = this.store.getState(); + const { aiMenuState } = this.store.getState(); if ( aiMenuState === "closed" || - aiMenuState.status !== "error" - // !this.previousRequestOptions TODO + aiMenuState.status !== "error" || + !this.chatSession ) { throw new Error("retry() is only valid when a previous response failed"); } - if (!chat) { - throw new Error("chat not found in retry()"); - } - - if (chat?.status === "error") { + /* + Design decisions: + - we cannot use chat.regenerate() because the document might have been updated already by toolcalls that failed mid-way + - we also cannot revert the document changes and use chat.regenerate(), + because we might want to retry a subsequent user-direction that failed, not the original one + - this means we always need to send the new document state to the LLM + - an alternative would be to take a snapshot of the document before the LLM call, and revert to that specific state + when a call fails + */ + + if (this.chatSession?.chat.status === "error") { // the LLM call failed (i.e. a network error) - chat.regenerate(); + return this.callLLM({ + ...this.chatSession.previousRequestOptions, + userPrompt: `An error occured in the previous request. Please retry to accomplish the last user prompt.`, + }); } else { // an error occurred while parsing / executing the previous LLM call // give the LLM a chance to fix the error return this.callLLM({ - userPrompt: `An error occured in the previous tool call. Please retry.`, + ...this.chatSession.previousRequestOptions, + userPrompt: `An error occured while executing the previous tool call. Please retry to accomplish the last user prompt.`, }); } } @@ -313,10 +319,6 @@ export class AIExtension extends BlockNoteExtension { } } - // tool call results - // errors - // TODO: retries - /** * Execute a call to an LLM and apply the result to the editor */ @@ -325,17 +327,20 @@ export class AIExtension extends BlockNoteExtension { this.editor.forkYDocPlugin?.fork(); try { - if (!this.store.getState().chat) { - // TODO: what if transport changes? - console.log("new chat"); - this._store.setState({ + if (!this.chatSession) { + // note: in the current implementation opts.transport is only used when creating a new chat + // (so changing transport for a subsequent call in the same chat-session is not supported) + this.chatSession = { + previousRequestOptions: opts, chat: new Chat({ sendAutomaticallyWhen: () => false, transport: opts.transport || this.options.getState().transport, }), - }); + }; + } else { + this.chatSession.previousRequestOptions = opts; } - const chat = this.store.getState().chat!; + const chat = this.chatSession.chat; const globalOpts = this.options.getState(); const { @@ -355,18 +360,18 @@ export class AIExtension extends BlockNoteExtension { ...opts, }; - let { messageSender } = { + let { aiRequestSender } = { ...rest, }; - if (messageSender && promptBuilder) { + if (aiRequestSender && promptBuilder) { throw new Error( "messageSender and promptBuilder cannot be used together", ); } - if (!messageSender) { - messageSender = promptMessageSender( + if (!aiRequestSender) { + aiRequestSender = promptAIRequestSender( promptBuilder ?? defaultHTMLPromptBuilder, defaultHTMLPromptDataBuilder, ); @@ -388,7 +393,6 @@ export class AIExtension extends BlockNoteExtension { ? this.editor.getSelectionCutBlocks() : undefined; - // TODO, works with retry? const streamTools = ( streamToolsProvider ?? htmlBlockLLMFormat.getStreamToolsProvider() ).getStreamTools( @@ -418,25 +422,25 @@ export class AIExtension extends BlockNoteExtension { } }); - await messageSender.sendMessage({ - editor: this.editor, - chat, - blockNoteUserPrompt: { - userPrompt, - selectedBlocks: selectionInfo?.blocks, - streamTools, - emptyCursorBlockToDelete, + await aiRequestSender.sendAIRequest( + { + editor: this.editor, + chat, + blockNoteUserPrompt: { + userPrompt, + selectedBlocks: selectionInfo?.blocks, + streamTools, + emptyCursorBlockToDelete, + }, }, - }); + opts.chatRequestOptions, + ); // TODO: what if no tool calls were made? await executePromise; this.setAIResponseStatus("user-reviewing"); } catch (e) { - // TODO in error state, should we discard the forked document? - - debugger; this.setAIResponseStatus({ status: "error", error: e, @@ -464,33 +468,3 @@ export function createAIExtension( export function getAIExtension(editor: BlockNoteEditor) { return editor.extension(AIExtension); } - -export type MessageSender = { - sendMessage: (opts: { - editor: BlockNoteEditor; - chat: Chat; - blockNoteUserPrompt: BlockNoteUserPrompt; - }) => Promise; -}; - -function promptMessageSender( - promptBuilder: PromptBuilder, - promptInputDataBuilder: PromptInputDataBuilder, -): MessageSender { - return { - async sendMessage(opts) { - const promptData = await promptInputDataBuilder( - opts.editor, - opts.blockNoteUserPrompt, - ); - - await promptBuilder(opts.chat.messages, promptData); - - return opts.chat.sendMessage(undefined, { - metadata: { - streamTools: opts.blockNoteUserPrompt.streamTools, - }, - }); - }, - }; -} diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts deleted file mode 100644 index f620c83293..0000000000 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { ChatTransport, UIMessage } from "ai"; -import { MessageSender } from "../AIExtension.js"; -import type { PromptBuilder } from "./formats/PromptBuilder.js"; -import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; -import { StreamToolsProvider } from "./index.js"; - -type MakeOptional = Omit & Partial>; - -// export type ExecuteLLMRequestOptions = { -// messages: UIMessage[]; -// streamTools: StreamTool[]; -// // TODO: needed? -// llmRequestOptions: MakeOptional; -// onStart?: () => void; -// }; - -export type LLMRequestHelpers = { - /** - * Customize how your LLM backend is called. - * Implement this function if you want to call a backend that is not compatible with - * the Vercel AI SDK - */ - transport?: ChatTransport; - - streamToolsProvider?: StreamToolsProvider; -} & ( - | { - /** - * The `PromptBuilder` to use for the LLM call - * - * (A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's prompt - * and turns it into an AI SDK `CoreMessage` array to be passed to the LLM) - * - * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) - */ - promptBuilder?: PromptBuilder; - - messageSender?: never; - } - | { - // messageSender variant - promptBuilder?: never; - messageSender?: MessageSender; - } -); - -export type LLMRequestOptions = { - /** - * The user prompt to use for the LLM call - */ - userPrompt: string; - - /** - * Whether to use the editor selection for the LLM call - * - * @default true - */ - useSelection?: boolean; - /** - * If the user's cursor is in an empty paragraph, automatically delete it when the AI - * is starting to write. - * - * (This is used when a user starts typing `/ai` in an empty block) - * - * @default true - */ - deleteEmptyCursorBlock?: boolean; -} & LLMRequestHelpers; diff --git a/packages/xl-ai/src/api/LLMResponse.ts b/packages/xl-ai/src/api/LLMResponse.ts deleted file mode 100644 index 03638050e5..0000000000 --- a/packages/xl-ai/src/api/LLMResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js"; -import { AsyncIterableStream } from "../util/stream.js"; - -/** - * Result of an LLM call with stream tools - */ -export type OperationsResult[]> = - AsyncIterableStream<{ - /** - * The operation the LLM wants to execute - */ - operation: StreamToolCall; - /** - * Whether {@link operation} is an update to the previous operation in the stream. - * - * For non-streaming mode, this will always be `false` - */ - isUpdateToPreviousOperation: boolean; - /** - * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) - * - * For non-streaming mode, this will always be `false` - */ - isPossiblyPartial: boolean; - }>; diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index 201dfd3433..b8ac5d6dda 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -1,47 +1,29 @@ -import { Block, BlockNoteEditor } from "@blocknote/core"; +import { BlockNoteEditor } from "@blocknote/core"; import { UIMessage } from "ai"; -import { StreamTool } from "../../streamTool/streamTool.js"; - -/* -We want users to be able to easily customize the prompts send to an LLM, -especially since different models might need slightly different prompts. - -For this, we use PromptBuilders that the - -Every format (html, markdown, json) has a default PromptBuilder that is used if no custom one is provided, -which is also exposed as `llm.html.defaultPromptBuilder` etc. for possible reuse. -*/ - -export type BlockNoteUserPrompt = { - /** - * The user's prompt - */ - userPrompt: string; - /** - * The selection of the editor which the LLM should operate on - */ - selectedBlocks?: Block[]; - /** - * The id of the block that should be excluded from the LLM call, - * this is used when using the AI slash menu in an empty block - */ - emptyCursorBlockToDelete?: string; - - /** - * The stream tools that can be used by the LLM - */ - streamTools: StreamTool[]; -}; +import { BlockNoteUserPrompt } from "../../types.js"; /** - * A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's promot - * and turns it into an array of CoreMessage (AI SDK) to be passed to the LLM. + * We want users to be able to easily customize the prompts send to an LLM, + * especially since different models / use-cases might need slightly different prompts. + + * A PromptBuilder is a function that takes information about the document and user prompt (inputData), + * and modifies the messages to be sent to the LLM (`messages` array). */ export type PromptBuilder = ( messages: UIMessage[], inputData: E, ) => Promise; +/** + * A separate function that builds the input data for the PromptBuilder based on the BlockNoteUserPrompt and + * current document (editor state). + * + * This is split from the PromptBuilder so that if you want, you can build the input data on the client side, + * and run the PromptBuilder on the server side to modify the Messages sent to the LLM. + * + * The default implementation (using promptAIRequestSender) handles all of this client-side and just submits the + * modified messages to the LLM. + */ export type PromptInputDataBuilder = ( editor: BlockNoteEditor, blockNoteUserPrompt: BlockNoteUserPrompt, diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 623e8cb6bc..13ac948eab 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -5,7 +5,7 @@ import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { doLLMRequest } from "../../../types.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { htmlBlockLLMFormat } from "./htmlBlocks.js"; diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index df6f7b2b66..95a1326959 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -7,7 +7,7 @@ import { setupServer } from "msw/node"; import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { doLLMRequest } from "../../../types.js"; import { jsonLLMFormat } from "./json.js"; // Create client and models outside of test suites so they can be shared diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts index 7b92933eec..859573178c 100644 --- a/packages/xl-ai/src/api/formats/json/json.test.ts +++ b/packages/xl-ai/src/api/formats/json/json.test.ts @@ -9,7 +9,7 @@ import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { doLLMRequest } from "../../../types.js"; import { jsonLLMFormat } from "./json.js"; const BASE_FILE_PATH = path.resolve( diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts index 75a4f79e01..8cc2853c03 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts @@ -8,7 +8,7 @@ import path from "path"; import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { doLLMRequest } from "../../../types.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { markdownBlocksLLMFormat } from "./markdownBlocks.js"; diff --git a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts new file mode 100644 index 0000000000..698d8c9c98 --- /dev/null +++ b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts @@ -0,0 +1,32 @@ +import { AIRequestSender } from "../../types.js"; +import { HTMLPromptData } from "./html-blocks/htmlPromptData.js"; +import { PromptBuilder, PromptInputDataBuilder } from "./PromptBuilder.js"; + +export function promptAIRequestSender( + promptBuilder: PromptBuilder, + promptInputDataBuilder: PromptInputDataBuilder, +): AIRequestSender { + return { + async sendAIRequest(aiRequest, options) { + // build the prompt data + const promptData = await promptInputDataBuilder( + aiRequest.editor, + aiRequest.blockNoteUserPrompt, + ); + + // update the chat history with new messages based on the prompt data + await promptBuilder(aiRequest.chat.messages, promptData); + + // submit the AI request via the underlying transport to the LLM + return aiRequest.chat.sendMessage(undefined, { + ...options, + metadata: { + ...(options?.metadata ?? {}), + // TODO: metadata or body? + // TODO: where is this translated to JSON?? + streamTools: aiRequest.blockNoteUserPrompt.streamTools, + }, + }); + }, + }; +} diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 8dfab6a786..1176e81483 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -1,6 +1,7 @@ import { BlockNoteEditor } from "@blocknote/core"; import { StreamTool } from "../streamTool/streamTool.js"; import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; +import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; import { jsonLLMFormat } from "./formats/json/json.js"; import { markdownBlocksLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js"; import { PromptBuilder } from "./formats/PromptBuilder.js"; @@ -30,7 +31,7 @@ export type LLMFormat = { * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) */ - defaultPromptBuilder: PromptBuilder; + defaultPromptBuilder: PromptBuilder; /** * Helper functions which can be used when implementing a custom PromptBuilder. * The signature depends on the specific format diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts index 19bbdb377b..a677c1ef44 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -1,5 +1,4 @@ import { DeepPartial, UIMessageChunk } from "ai"; -import { OperationsResult } from "../../../api/LLMResponse.js"; import { createAsyncIterableStream, createAsyncIterableStreamFromAsyncIterable, @@ -12,6 +11,30 @@ import { uiMessageStreamObjectDataToTextStream, } from "./partialObjectStreamUtil.js"; +import { AsyncIterableStream } from "../../../util/stream.js"; + +/** + * Result of an LLM call with stream tools + */ +type OperationsResult[]> = AsyncIterableStream<{ + /** + * The operation the LLM wants to execute + */ + operation: StreamToolCall; + /** + * Whether {@link operation} is an update to the previous operation in the stream. + * + * For non-streaming mode, this will always be `false` + */ + isUpdateToPreviousOperation: boolean; + /** + * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation) + * + * For non-streaming mode, this will always be `false` + */ + isPossiblyPartial: boolean; +}>; + // stream vs generate, responsibility of backend // text vs object, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index c7c95a9bf8..e3272e302f 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -30,6 +30,14 @@ function processToolCallParts( continue; } + const toolName = part.type.replace("tool-", ""); + + if (toolName !== "operations") { + // we only process the combined operations tool call + // in a future improvement we can add more generic support for different tool streaming + continue; + } + const toolCallId = part.toolCallId; const toolCallData = getToolCallStreamData({ diff --git a/packages/xl-ai/src/types.ts b/packages/xl-ai/src/types.ts new file mode 100644 index 0000000000..ac35f750c0 --- /dev/null +++ b/packages/xl-ai/src/types.ts @@ -0,0 +1,136 @@ +import { Chat } from "@ai-sdk/react"; +import { Block, BlockNoteEditor } from "@blocknote/core"; +import { ChatTransport, UIMessage } from "ai"; +import type { PromptBuilder } from "./api/formats/PromptBuilder.js"; +import { HTMLPromptData } from "./api/formats/html-blocks/htmlPromptData.js"; +import { StreamToolsProvider } from "./index.js"; +import { StreamTool } from "./streamTool/streamTool.js"; + +/** + * Extra options (header, body, metadata) that can be passed to LLM requests + * This is a pattern we take from the Vercel AI SDK + */ +export type ChatRequestOptions = Parameters["sendMessage"]>[1]; + +/** + * Information about the user request and which streamtools are available + */ +export type BlockNoteUserPrompt = { + /** + * The user's prompt + */ + userPrompt: string; + /** + * The selection of the editor which the LLM should operate on + */ + selectedBlocks?: Block[]; + /** + * The id of the block that should be excluded from the LLM call, + * this is used when using the AI slash menu in an empty block + */ + emptyCursorBlockToDelete?: string; + + /** + * The stream tools that can be used by the LLM + */ + streamTools: StreamTool[]; +}; + +/** + * An AIRequest represents a user request for an editor AI call + */ +export type AIRequest = { + /** + * The editor from which we can read document state + */ + editor: BlockNoteEditor; + + /** + * The chat object (from the AI SDK) + * is used to keep Message history, and to submit the LLM request via the underlying transport to the LLM + */ + chat: Chat; + + /** + * Information about the user request and which streamtools are available + */ + blockNoteUserPrompt: BlockNoteUserPrompt; +}; + +/** + * Responsible for sending the AI request to the LLM backend + */ +export type AIRequestSender = { + sendAIRequest: ( + AIRequest: AIRequest, + options: ChatRequestOptions, + ) => Promise; +}; + +export type LLMRequestHelpers = { + /** + * Customize how your LLM backend is called. + * Implement this function if you want to call a backend that is not compatible with + * the Vercel AI SDK + */ + transport?: ChatTransport; + + /** + * Customize which stream tools are available to the LLM + */ + streamToolsProvider?: StreamToolsProvider; + + /** + * Extra options (header, body, metadata) that can be passed to LLM requests + * This is a pattern we take from the Vercel AI SDK + */ + chatRequestOptions?: ChatRequestOptions; +} & ( + | { + /** + * The `PromptBuilder` to use for the LLM call + * + * (A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's prompt + * and turns it into an AI SDK `CoreMessage` array to be passed to the LLM) + * + * TODO + * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) + */ + promptBuilder?: PromptBuilder; + + aiRequestSender?: never; + } + | { + // aiRequestSender variant + promptBuilder?: never; + /** + * Responsible for sending the AI request to the LLM backend + * + * @default promptAIRequestSender + */ + aiRequestSender?: AIRequestSender; + } +); + +export type LLMRequestOptions = { + /** + * The user prompt to use for the LLM call + */ + userPrompt: string; + + /** + * Whether to use the editor selection for the LLM call + * + * @default true + */ + useSelection?: boolean; + /** + * If the user's cursor is in an empty paragraph, automatically delete it when the AI + * is starting to write. + * + * (This is used when a user starts typing `/ai` in an empty block) + * + * @default true + */ + deleteEmptyCursorBlock?: boolean; +} & LLMRequestHelpers; From dad6a8e8aa8dcf812c0536d1d90957ce95a138af Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 17:14:22 +0200 Subject: [PATCH 28/68] fix --- packages/xl-ai/src/AIExtension.ts | 5 +- .../html-blocks/defaultHTMLPromptBuilder.ts | 28 +-------- .../clientside/ClientSideTransport.ts | 28 ++++++++- .../vercelAiSdk/util/chatHandlers.ts | 58 +++++++++++-------- 4 files changed, 64 insertions(+), 55 deletions(-) diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 19ba881c3c..c8eee07639 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -256,6 +256,7 @@ export class AIExtension extends BlockNoteExtension { if (this.chatSession?.chat.status === "error") { // the LLM call failed (i.e. a network error) + // console.log("retry failed LLM call", this.chatSession.chat.error); return this.callLLM({ ...this.chatSession.previousRequestOptions, userPrompt: `An error occured in the previous request. Please retry to accomplish the last user prompt.`, @@ -263,7 +264,7 @@ export class AIExtension extends BlockNoteExtension { } else { // an error occurred while parsing / executing the previous LLM call // give the LLM a chance to fix the error - + // console.log("retry failed tool execution"); return this.callLLM({ ...this.chatSession.previousRequestOptions, userPrompt: `An error occured while executing the previous tool call. Please retry to accomplish the last user prompt.`, @@ -446,7 +447,7 @@ export class AIExtension extends BlockNoteExtension { error: e, }); // eslint-disable-next-line no-console - console.warn("Error calling LLM", e); + console.warn("Error calling LLM", e, this.chatSession?.chat.messages); } } } diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index 027b896aa1..ce7f3bbd79 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -55,7 +55,7 @@ function promptManipulateSelectionHTMLBlocks( { type: "text", text: `You're manipulating a selected part of a text document using HTML blocks. - Make sure to follow the json schema provided and always include the trailing $ in ids. + Make sure to follow the json schema provided and always include the trailing $ in ids. List items are 1 block with 1 list item each, so block content \`
  • item1
\` is valid, but \`
  • item1
  • item2
\` is invalid. We'll merge them automatically. This is the selection as an array of html blocks:`, }, @@ -85,16 +85,6 @@ function promptManipulateSelectionHTMLBlocks( }, ], }, - { - role: "system", - id: "html-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", id: "html-user-prompt", @@ -132,10 +122,6 @@ function promptManipulateDocumentUseHTMLBlocks( role: "user", id: "html-user-prompt-" + messages.length, parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, { type: "text", text: opts.userPrompt, @@ -156,7 +142,7 @@ function promptManipulateDocumentUseHTMLBlocks( Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). List items are 1 block with 1 list item each, so block content \`
  • item1
\` is valid, but \`
  • item1
  • item2
\` is invalid. We'll merge them automatically. For code blocks, you can use the \`data-language\` attribute on a code block to specify the language. - This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, }, ], }, @@ -189,16 +175,6 @@ function promptManipulateDocumentUseHTMLBlocks( }, ], }, - { - role: "system", - id: "html-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", id: "html-user-prompt", diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index c88562e1ad..ff9177d2ce 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -117,7 +117,7 @@ export class ClientSideTransport * * This is the streaming version. */ - protected async streamOperations( + protected async streamObject( messages: UIMessage[], streamTools: StreamTool[], ) { @@ -231,14 +231,36 @@ export class ClientSideTransport if (this.opts.objectGeneration) { if (this.opts.stream) { - return this.streamOperations(messages, streamTools); + return this.streamObject(messages, streamTools); } else { return this.generateObject(messages, streamTools); } } if (this.opts.stream) { - return this.streamText(messages, streamTools); + // this can be used to simulate initial network errors + // if (Math.random() < 0.5) { + // throw new Error("fake network error"); + // } + + const ret = await this.streamText(messages, streamTools); + + // this can be used to simulate network errors while streaming + // let i = 0; + // return ret.pipeThrough( + // new TransformStream({ + // transform(chunk, controller) { + // controller.enqueue(chunk); + + // if (++i === 200) { + // console.log("cancel stream"); + // controller.error(new Error("fake network error")); + // } + // }, + // }), + // ); + + return ret; } else { // https://github.com/vercel/ai/issues/8380 throw new Error("Not implemented (generateText)"); diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index e3272e302f..5bddbff855 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -12,6 +12,8 @@ type ToolCallStreamData = { DeepPartial<{ operations: StreamToolCall[] }> >; complete: boolean; + toolName: string; + toolCallId: string; executor: StreamToolExecutor; }; @@ -54,6 +56,8 @@ function processToolCallParts( */ function createToolCallStream( streamTools: StreamTool[], + toolName: string, + toolCallId: string, ): ToolCallStreamData { const stream = new TransformStream< DeepPartial<{ operations: StreamToolCall[] }> @@ -74,6 +78,8 @@ function createToolCallStream( writer, complete: false, executor, + toolName, + toolCallId, }; } @@ -110,39 +116,21 @@ export async function setupToolCallStreaming( ) { const toolCallStreams = new Map(); - const executePromises: Promise[] = []; - let first = true; const unsub = chat["~registerMessagesCallback"](() => { processToolCallParts(chat, (data) => { if (!toolCallStreams.has(data.toolCallId)) { - const toolCallStreamData = createToolCallStream(streamTools); + const toolCallStreamData = createToolCallStream( + streamTools, + data.toolName, + data.toolCallId, + ); toolCallStreams.set(data.toolCallId, toolCallStreamData); if (first) { first = false; onStart(); } - executePromises.push( - toolCallStreamData.executor.waitTillEnd().then( - () => { - chat.addToolResult({ - tool: data.toolName, - toolCallId: data.toolCallId, - output: { status: "ok" }, - }); - }, - (error) => { - // TODO: in a later version of the sdk, make sure we set output-error if possible? - // (currently no such method seems to be exposed) - chat.addToolResult({ - tool: data.toolName, - toolCallId: data.toolCallId, - output: { status: "error", error: getErrorMessage(error) }, - }); - }, - ), - ); } return toolCallStreams.get(data.toolCallId)!; }); @@ -179,11 +167,33 @@ export async function setupToolCallStreaming( }); // wait until all messages have been received + // (possible improvement(?): we can abort the request if any of the tool calls fail + // instead of waiting for the entire llm response) await statusHandler; // let all stream executors finish, this can take longer due to artificial delays // (e.g. to simulate human typing behaviour) - await Promise.all(executePromises); + + const toolCalls = Array.from(toolCallStreams.values()); + const results = await Promise.allSettled( + toolCalls.map((data) => data.executor.waitTillEnd()), + ); + + // process results + results.forEach((result, index) => { + chat.addToolResult({ + tool: toolCalls[index].toolName, + toolCallId: toolCalls[index].toolCallId, + output: + result.status === "fulfilled" + ? { status: "ok" } + : { status: "error", error: getErrorMessage(result.reason) }, + }); + }); + + if (results.some((result) => result.status === "rejected")) { + throw new Error("Tool call failed"); + } if (chat.error) { // if there was an error, it's likely we already throwed it in the line above, From fb7fb21a7bce1aa12d309e9f7cc5221990e10ca0 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 17:19:20 +0200 Subject: [PATCH 29/68] small fix --- packages/xl-ai/src/AIExtension.ts | 3 +-- packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index c8eee07639..df9f8c56e6 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -292,7 +292,7 @@ export class AIExtension extends BlockNoteExtension { ) { const aiMenuState = this.store.getState().aiMenuState; if (aiMenuState === "closed") { - return; // TODO: log error? + return; } if (status === "ai-writing") { @@ -345,7 +345,6 @@ export class AIExtension extends BlockNoteExtension { const globalOpts = this.options.getState(); const { - // TODO: how to pass extra metadata / body userPrompt, useSelection, deleteEmptyCursorBlock, diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 13ac948eab..9d5fae4045 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -5,7 +5,7 @@ import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../../types.js"; + import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { htmlBlockLLMFormat } from "./htmlBlocks.js"; From 6918ec98773302aeb22e729bd6e192986604872e Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 18:30:14 +0200 Subject: [PATCH 30/68] fix unit tests --- packages/xl-ai/src/AIExtension.ts | 97 ++--------------- packages/xl-ai/src/api/LLMRequest.ts | 101 ++++++++++++++++++ ...k_1_65f04fd42a04dcca12de00a733958f35.json} | 4 +- ...)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json} | 4 +- ...)_1_c7d6978b09036961e8430bbe8403e402.json} | 4 +- ...)_1_1de04509d43d719c355118e54aac5695.json} | 4 +- ...)_1_490bd381faa3237b3e0100bc2f4a41e9.json} | 4 +- ...ck_1_636c346a04a30c96e2c1c249332f8c03.json | 15 +++ ...)_1_6b66f4e214f72bdd99d9eb9651d10e02.json} | 4 +- ...d)_1_89dd734a48e5bb6a0ab581f12545c16c.json | 15 --- ...c)_1_5153f1102c266fbdae2a57a0daf45d18.json | 15 +++ ...c)_1_5cac750202d6046abd8166098112fed4.json | 15 --- ...d)_1_15d07556d6eeaf1468d50c545daa64c1.json | 15 --- ...d)_1_6678671a89d2b0dae56494e1a0c5dca7.json | 15 +++ ...t)_1_7c24b8f8171deedb5438290ebfa67ae1.json | 15 +++ ...t)_1_b3d93e35bb904c82cbfef740afc160b6.json | 15 --- ...ck_1_1362a8882a7ce918bda9111ad233123e.json | 15 --- ...ck_1_99059264437bec6dfb23fc667f1faf5e.json | 15 +++ ...d)_1_22cee362389152a9f2eecb273184da49.json | 15 --- ...d)_1_ba651e401645ce4adc5ee557436f8b23.json | 15 +++ ...c)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json | 15 +++ ...c)_1_e907c7a07830a0dbd5739c6647074a6b.json | 15 --- ...d)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json | 15 +++ ...d)_1_833fa6583ec54362359eb3ad3bb7bee9.json | 15 --- ...t)_1_8e90c887a5e6d318a269ccd8526978e7.json | 15 --- ...t)_1_ccaa26a39b8dce298abdf194e096f42d.json | 15 +++ ...h_1_41ff47b4fca8d8385d05699430391371.json} | 4 +- ...on_1_33755207ae3d7cb4fcdc044d1ec10ce0.json | 15 --- ...on_1_39cf1461b71867689c0f440d8bd07a16.json | 15 +++ ...ph_1_851b7242fd29b343abb0a86c005bb650.json | 15 +++ ...on_1_9a144ecbde0b871de374e8ca0e3fa323.json | 15 +++ ...on_1_d94f274cff2542fe1b248e007753da77.json | 15 --- ...ph_1_0c06e1f34af80242cc3dc017cb7b77f7.json | 15 --- ...ph_1_c684f68b8f8b674dba89187794598da7.json | 15 +++ ...on_1_6a59628efbb4af73805eb2359a908f14.json | 15 --- ...on_1_837eb32ef792caa67d1aaa4f9b7d7b91.json | 15 +++ ...k_1_80e6e86a31a71d50adeb8404f21c8dfa.json} | 4 +- ...ck_1_43b215e15138f6f142a80fd451a58b29.json | 15 +++ ...ck_1_1cd1e0ebf217dc48b3b49ec536911be8.json | 15 +++ ...ck_1_841f6c175f84f924ec16a526ad71e33d.json | 15 --- ...k_1_f6366ff3ba630d781bc34e5504b23982.json} | 4 +- ...k_1_408c7874e5c50b9977eef38e60587f5c.json} | 4 +- ...t_1_5192c204d173123d2221d39a45ff0dfa.json} | 4 +- ...t_1_9dec14ec316359a414e2cb6aecc91acd.json} | 4 +- ...n_1_3d62473ba5dcb800f0e94a6f3c996c9c.json} | 4 +- ...e_1_c21d0b742de489f48d10cdb0a2368742.json} | 4 +- ...k_1_04e5b18dcbf265726fc60add5d49579b.json} | 4 +- ...n_1_011d7335e3bc7e40685788d29b8995fd.json} | 4 +- ...t_1_e6a5964ece38842634196e2158af46a5.json} | 4 +- ...p_1_bd32f736daf0ace65c5ef96f85d33073.json} | 4 +- ...t_1_166f3480a334b0bb61dd9f71725161c7.json} | 4 +- ...)_1_5c8482500b8bcb18d002dad7d7ce3b56.json} | 4 +- ...)_1_732a538612df511185897838aca811b7.json} | 4 +- ...on_1_8fa2a7559da234ea5baba7e27d421e2e.json | 15 +++ ...on_1_b45440e84c9d81d6dead47bd37f8c771.json | 15 --- ...st_1_2857ec14532ecfb9e00636b7cd8e34e2.json | 15 +++ ...st_1_71a8ef900853abac07443ce40a054680.json | 15 --- ...t_1_766a8e965e9476fd9073925774f2b18e.json} | 4 +- ...e_1_9abd187cb14c5c3012da9eac6dff51ad.json} | 4 +- ...rk_1_ce3471aa159401d181a031a94f536a6f.json | 15 +++ ...nk_1_3c75ece673f586d1fb428c4250e9726b.json | 15 --- ...nk_1_a013185ff454fa613135a1d2aae8e0cd.json | 15 +++ ...nt_1_e101f067bae31019754a533d650420f9.json | 15 --- ...t_1_ee6053865d15c053ac6b94f0cf5ffd17.json} | 4 +- ...nt_1_cf634699b3239ed229f0b69543118654.json | 15 +++ ...on_1_7b34734780def271970ecaef1786138c.json | 15 +++ ...on_1_c126a42e416d569f6a46d8d62a7c83c5.json | 15 --- ...te_1_59cc07c257b80b03c8982433551e5fda.json | 15 --- ...te_1_e447a0275121e64f7e8970883902c014.json | 15 +++ ...k_1_a8a9a847cc8f56ae71bab8677082b908.json} | 4 +- ...on_1_606370cd230fb0aa57852541e2826c16.json | 15 +++ ...on_1_bf143f40a5064e08f776cb104a132cd5.json | 15 --- ...nt_1_02ee54eac49ee27796690079ae102928.json | 15 +++ ...nt_1_f8ff406bd3b389d1c2a77bb991a80206.json | 15 --- ...op_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json | 15 +++ ...op_1_783882c6aae6d65c404ce0a7d41275ef.json | 15 --- ...t_1_08ae00872a9f2c6f8b2a5e12758444bd.json} | 4 +- ...xt_1_71a7599d18815777e331d4a9db56d39d.json | 15 --- ...h)_1_83e8c09f45e23e2dce4865ab7687a636.json | 15 --- ...)_1_c158abbfeb39cd0079a2e558305693dd.json} | 4 +- ...d)_1_9102cbc1c53c062212b17b10050f9b05.json | 15 +++ ...d)_1_d72e1057215df948279c33e394e182d1.json | 15 --- ...on_1_1479fba33d2f5126867fd3a9d73e37f4.json | 15 +++ ...on_1_601e089579d3047dcb2dc62e943d20e9.json | 15 --- ...st_1_83697ff9e8b68ed3b717427d1f615fe7.json | 15 --- ...st_1_d5cefdf40285a9390452e873ce6cf64d.json | 15 +++ ...nt_1_8677e4e9a17acfed4aef83379790b198.json | 15 --- ...nt_1_897a33c5523c928b3293cbff3b4b61b4.json | 15 +++ ...e_1_9f0d14a9822c996470cda6abb86cd593.json} | 4 +- ...pe_1_d2ed2696edc4763285392fcd631ad144.json | 15 --- ...rk_1_64adc98ca4a79fe75565cf984f6b9ee6.json | 15 --- ...rk_1_9c740a830526aae5c1681140dbffce61.json | 15 +++ ...nk_1_59fabaea832d26ec8ec8f081c7a529a4.json | 15 --- ...nk_1_9d2ea9b77f66167634b2565bccc1fcd3.json | 15 +++ ...nt_1_2fcde5df596501a21514fd6c781016ae.json | 15 --- ...nt_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json | 15 +++ ...nt_1_13fbb3be256ec82e826b622cdcae5247.json | 15 +++ ...nt_1_a44f5f3213caeacb4097fa2f999d8dbc.json | 15 --- ...on_1_04b206e81d5fa5883392048171a9dbf0.json | 15 --- ...on_1_9ac28fa826d75634499518503f07c102.json | 15 +++ ...te_1_0185e23dcac3614328581a4bdc8c5412.json | 15 --- ...te_1_896f5d4e6e06b37d71e5b24ccff257b7.json | 15 +++ ...rk_1_765368819c77871f23a56edfe3041c90.json | 15 +++ ...rk_1_7db10c7b76b46c21e20df5ec249c6f11.json | 15 --- ...on_1_143aabdf8ac21ed460c808ebc490c41d.json | 15 +++ ...on_1_63050bff5088b8d04fbcd651e05ae882.json | 15 --- ...nt_1_2d4c1e5b3b1498596445e7a3cb2c915c.json | 15 +++ ...nt_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json | 15 --- ...op_1_b2492cfb8ed8d2763405374a07be39ac.json | 15 --- ...op_1_b7b1415ef4b5afbd00eed961b84f2f2f.json | 15 +++ ...xt_1_1c22626de0e444ba6765152158a82c06.json | 15 +++ ...xt_1_e53435bc11f15a90456f69fb7826125c.json | 15 --- ...h)_1_1c6f556ad52f3df41659515bfc1b1aa7.json | 15 --- ...h)_1_23860fc29605f9328d6e0b5beceedd02.json | 15 +++ ...d)_1_209aa14d6a0de75ac1558f50749be796.json | 15 --- ...d)_1_fce264c033bc4b8dc3ab4110f96211a9.json | 15 +++ ...on_1_a59a9b5891c5d484937aae60bb84ea07.json | 15 --- ...on_1_de89161ffe07c2ee9d023475081863c1.json | 15 +++ ...st_1_3caac015b33d4eeda58bd0af3a6a03da.json | 15 --- ...st_1_8729fe16c66e8648ade70660e5914c0e.json | 15 +++ ...nt_1_374c98f6cf65c81138b95a534caa4be6.json | 15 --- ...nt_1_a23db5d3055574260d8823221d560ba8.json | 15 +++ ...pe_1_805bfc82ee9253bcb1cd35617f17fc4d.json | 15 +++ ...pe_1_9197856e6f82ebff9a1846cbfc765a7b.json | 15 --- .../formats/html-blocks/htmlBlocks.test.ts | 33 ++++-- .../src/api/formats/html-blocks/htmlBlocks.ts | 2 +- .../src/api/formats/tests/sharedTestCases.ts | 26 +++-- .../clientside/ClientSideTransport.ts | 4 +- .../vercelAiSdk/util/chatHandlers.ts | 4 +- 129 files changed, 918 insertions(+), 871 deletions(-) create mode 100644 packages/xl-ai/src/api/LLMRequest.ts rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{Add heading (h1) and code block_1_978f96ab79514117598ce615ed0d216e.json => Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a list (end)_1_b943c8d1d4a88199049f2cbe696fbfbe.json => add a list (end)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (empty doc)_1_40aff463bb8a67bd634e8126aa4a5b3c.json => add a new paragraph (empty doc)_1_c7d6978b09036961e8430bbe8403e402.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (end)_1_1088e131f22a66ff3f481d486cddea93.json => add a new paragraph (end)_1_1de04509d43d719c355118e54aac5695.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (start)_1_e221f5a23fd9e5f358291ebfa4df3f17.json => add a new paragraph (start)_1_490bd381faa3237b3e0100bc2f4a41e9.json} (69%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json => Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json} (54%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add and update paragraph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json => add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json} (64%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_33755207ae3d7cb4fcdc044d1ec10ce0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json delete mode 100644 packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json create mode 100644 packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{delete first block_1_046ddae2286f36597c05b53211d9b18f.json => delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json} (62%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{drop mark and link and change text within mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json => drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{drop mark and link_1_36ab57c33a9b92cce12bd3cc2338abca.json => drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{modify nested content_1_880bc2c79fd0a55606bc3d4350f3f61b.json => modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json} (67%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{modify parent content_1_349b95a48f92584763e38280366e849d.json => modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{plain source block, add mention_1_8db7582d172169c8d97fa66df3e6f95c.json => plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{standard update_1_5385a2da1c45e1622a45a76f939b6add.json => standard update_1_c21d0b742de489f48d10cdb0a2368742.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in source block, remove mark_1_55d746e02a3178b820afabb3af591f99.json => styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in source block, remove mention_1_e73d0ee5659f2b999842cf3cde2a080f.json => styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in source block, replace content_1_291012f0f84823dcb3048ae5c5a0a5ac.json => styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in source block, update mention prop_1_64a1abcbf8b188a770f1148623bc68d4.json => styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in source block, update text_1_7d353e20ad801e6e45d345e96068902e.json => styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json} (64%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in target block, add mark (paragraph)_1_65069ec605ef6a1bd8d2aea501d9478f.json => styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{styles + ic in target block, add mark (word)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json => styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json} (62%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_b45440e84c9d81d6dead47bd37f8c771.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{update block type and content_1_4e119094b2f0d01391ba2b29c1b0e3eb.json => update block type and content_1_766a8e965e9476fd9073925774f2b18e.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{update block type_1_450063cb74b46323a73d507c480d2b08.json => update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json} (62%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/{styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json => modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json} (53%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/{modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json => styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json} (54%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json => Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json} (53%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_8d2db5980d3b724a694a7b9ddba8d6c8.json => Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json} (56%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/{Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json => Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json} (55%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index df9f8c56e6..8e6806223a 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -14,15 +14,9 @@ import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { defaultHTMLPromptBuilder } from "./api/formats/html-blocks/defaultHTMLPromptBuilder.js"; -import { htmlBlockLLMFormat } from "./api/formats/html-blocks/htmlBlocks.js"; -import { defaultHTMLPromptDataBuilder } from "./api/formats/html-blocks/htmlPromptData.js"; -import { promptAIRequestSender } from "./api/formats/promptAIRequestSender.js"; -import { trimEmptyBlocks } from "./api/promptHelpers/trimEmptyBlocks.js"; +import { doLLMRequest } from "./api/LLMRequest.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; -import { setupToolCallStreaming } from "./streamTool/vercelAiSdk/util/chatHandlers.js"; import { LLMRequestHelpers, LLMRequestOptions } from "./types.js"; -import { isEmptyParagraph } from "./util/emptyBlock.js"; type ReadonlyStoreApi = Pick< StoreApi, @@ -342,68 +336,18 @@ export class AIExtension extends BlockNoteExtension { this.chatSession.previousRequestOptions = opts; } const chat = this.chatSession.chat; - const globalOpts = this.options.getState(); - - const { - userPrompt, - useSelection, - deleteEmptyCursorBlock, - streamToolsProvider, - - promptBuilder, - transport, - ...rest - } = { - deleteEmptyCursorBlock: true, // default true + // merge the global options with the local options + const globalOpts = this.options.getState(); + opts = { ...globalOpts, ...opts, - }; - - let { aiRequestSender } = { - ...rest, - }; + } as LLMRequestOptions; - if (aiRequestSender && promptBuilder) { - throw new Error( - "messageSender and promptBuilder cannot be used together", - ); - } - - if (!aiRequestSender) { - aiRequestSender = promptAIRequestSender( - promptBuilder ?? defaultHTMLPromptBuilder, - defaultHTMLPromptDataBuilder, - ); - } - - const cursorBlock = useSelection - ? undefined - : this.editor.getTextCursorPosition().block; - - const emptyCursorBlockToDelete: string | undefined = - cursorBlock && - deleteEmptyCursorBlock && - isEmptyParagraph(cursorBlock) && - trimEmptyBlocks(this.editor.document).length > 0 - ? cursorBlock.id - : undefined; - - const selectionInfo = useSelection - ? this.editor.getSelectionCutBlocks() - : undefined; - - const streamTools = ( - streamToolsProvider ?? htmlBlockLLMFormat.getStreamToolsProvider() - ).getStreamTools( + await doLLMRequest( this.editor, - selectionInfo - ? { - from: selectionInfo._meta.startPos, - to: selectionInfo._meta.endPos, - } - : undefined, - // TODO: remove? + chat, + opts, (blockId: string) => { // NOTE: does this setState with an anon object trigger unnecessary re-renders? this._store.setState({ @@ -413,32 +357,11 @@ export class AIExtension extends BlockNoteExtension { }, }); }, - ); - - const executePromise = setupToolCallStreaming(streamTools, chat, () => { - this.setAIResponseStatus("ai-writing"); - if (emptyCursorBlockToDelete) { - this.editor.removeBlocks([emptyCursorBlockToDelete]); - } - }); - - await aiRequestSender.sendAIRequest( - { - editor: this.editor, - chat, - blockNoteUserPrompt: { - userPrompt, - selectedBlocks: selectionInfo?.blocks, - streamTools, - emptyCursorBlockToDelete, - }, + () => { + this.setAIResponseStatus("ai-writing"); }, - opts.chatRequestOptions, ); - // TODO: what if no tool calls were made? - await executePromise; - this.setAIResponseStatus("user-reviewing"); } catch (e) { this.setAIResponseStatus({ diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts new file mode 100644 index 0000000000..5a6502d532 --- /dev/null +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -0,0 +1,101 @@ +import { Chat } from "@ai-sdk/react"; +import { BlockNoteEditor } from "@blocknote/core"; +import { UIMessage } from "ai"; +import { setupToolCallStreaming } from "../streamTool/vercelAiSdk/util/chatHandlers.js"; +import { LLMRequestOptions } from "../types.js"; +import { isEmptyParagraph } from "../util/emptyBlock.js"; +import { defaultHTMLPromptBuilder } from "./formats/html-blocks/defaultHTMLPromptBuilder.js"; +import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; +import { defaultHTMLPromptDataBuilder } from "./formats/html-blocks/htmlPromptData.js"; +import { promptAIRequestSender } from "./formats/promptAIRequestSender.js"; +import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; + +// TODO: figure out naming of this vs. aiRequest etc +export async function doLLMRequest( + editor: BlockNoteEditor, + chat: Chat, + opts: LLMRequestOptions, + onBlockUpdated?: (blockId: string) => void, + onStart?: () => void, +) { + const { + userPrompt, + useSelection, + deleteEmptyCursorBlock, + streamToolsProvider, + promptBuilder, + transport, // TODO: unused + ...rest + } = { + deleteEmptyCursorBlock: true, // default true + ...opts, + }; + + let { aiRequestSender } = { + ...rest, + }; + + if (aiRequestSender && promptBuilder) { + throw new Error("messageSender and promptBuilder cannot be used together"); + } + + if (!aiRequestSender) { + aiRequestSender = promptAIRequestSender( + promptBuilder ?? defaultHTMLPromptBuilder, + defaultHTMLPromptDataBuilder, + ); + } + + const cursorBlock = useSelection + ? undefined + : editor.getTextCursorPosition().block; + + const emptyCursorBlockToDelete: string | undefined = + cursorBlock && + deleteEmptyCursorBlock && + isEmptyParagraph(cursorBlock) && + trimEmptyBlocks(editor.document).length > 0 + ? cursorBlock.id + : undefined; + + const selectionInfo = useSelection + ? editor.getSelectionCutBlocks() + : undefined; + + const streamTools = ( + streamToolsProvider ?? htmlBlockLLMFormat.getStreamToolsProvider() + ).getStreamTools( + editor, + selectionInfo + ? { + from: selectionInfo._meta.startPos, + to: selectionInfo._meta.endPos, + } + : undefined, + onBlockUpdated, + ); + + const executePromise = setupToolCallStreaming(streamTools, chat, () => { + onStart?.(); + if (emptyCursorBlockToDelete) { + editor.removeBlocks([emptyCursorBlockToDelete]); + } + }); + + await aiRequestSender.sendAIRequest( + { + editor: editor, + chat, + blockNoteUserPrompt: { + userPrompt, + selectedBlocks: selectionInfo?.blocks, + streamTools, + emptyCursorBlockToDelete, + }, + }, + opts.chatRequestOptions, + ); + + // TODO: what if no tool calls were made? + await executePromise; +} diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_978f96ab79514117598ce615ed0d216e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_978f96ab79514117598ce615ed0d216e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json index a7076330ed..220691599f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_978f96ab79514117598ce615ed0d216e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

Code

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

Code

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

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

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

You look great today!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1045,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01FxUywHx19EJ8vduz1Zu7Lf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01GMjeNnqgPpztgP27iBWdHN\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

You look great today!

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

You look great today!

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

You look great today!

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

Hello, world!

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

How are you?

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

Hello, world!

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

How are you?

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

You look great today!

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

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1068,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json new file mode 100644 index 0000000000..26c11f18b6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0b0f6f9d11f776300068cad87ea84c819384ee783020626250\",\n \"object\": \"response\",\n \"created_at\": 1758124158,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0b0f6f9d11f776300068cad87fea108193b2292c85a67dde25\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 615,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 670\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json index c7299b6a1b..f224a4eec4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_9145d656ac1ecf78b3e7ca413fb19ad0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9ea38088195a18bba8b25024e690f4c9e0c66b4e831\",\n \"object\": \"response\",\n \"created_at\": 1757403626,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9eabe148195bbf82a062060e67a0f4c9e0c66b4e831\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 717,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 751\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_0786894919d97b970068cad87c63508194855f2e8f51bd9709\",\n \"object\": \"response\",\n \"created_at\": 1758124156,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0786894919d97b970068cad87d42e0819498341051d84b2ca2\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 656\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json deleted file mode 100644 index 450ab7f7c4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_89dd734a48e5bb6a0ab581f12545c16c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9ca8f2481978d4dd49bed9794460885c6dcbd3bef57\",\n \"object\": \"response\",\n \"created_at\": 1757403594,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9cb162c8197b81d2e667a87da8e0885c6dcbd3bef57\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 618,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 668\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json new file mode 100644 index 0000000000..00d49654e0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_05afa4fce039979c0068cad8f571f08193be47a58d358eb927\",\n \"object\": \"response\",\n \"created_at\": 1758124277,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_05afa4fce039979c0068cad8f5f78481939a8ba0f9742d9adb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 576,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 604\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json deleted file mode 100644 index 77d0ecc916..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5cac750202d6046abd8166098112fed4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfda7dd9948195bdbde45281c2a8a5012a9e7d5e086289\",\n \"object\": \"response\",\n \"created_at\": 1757403774,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda7f2d7881958ba19856cb289f15012a9e7d5e086289\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 588,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 616\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json deleted file mode 100644 index 7ed5579c3c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_15d07556d6eeaf1468d50c545daa64c1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9c88dd08190bbd9a8d5867d8afb0e6599b4a1fa2b81\",\n \"object\": \"response\",\n \"created_at\": 1757403593,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9c9cf008190bc48ef6798b873040e6599b4a1fa2b81\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 616,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 650\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json new file mode 100644 index 0000000000..28b875d6cc --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_02356bbc5cbf57450068cad87a9b98819087e1ea247c177e95\",\n \"object\": \"response\",\n \"created_at\": 1758124154,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_02356bbc5cbf57450068cad87b3ee88190a79020a0491aac03\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 638\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json new file mode 100644 index 0000000000..3b46e207b4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_03e70b74837a15bb0068cad87911b881969b750928a1bf54ff\",\n \"object\": \"response\",\n \"created_at\": 1758124153,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03e70b74837a15bb0068cad879a2c08196b27a724c88f957cb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 638\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json deleted file mode 100644 index 87e161a14b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_b3d93e35bb904c82cbfef740afc160b6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9c713ac8194ae7d46a98f02eee30c58f53c224624e4\",\n \"object\": \"response\",\n \"created_at\": 1757403591,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9c7d1a88194b5d7b2151fd5f6d90c58f53c224624e4\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 616,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 650\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json deleted file mode 100644 index efe4843f42..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_1362a8882a7ce918bda9111ad233123e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"yUeGBGSHEM5U01\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"O3K5Un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PWLrcBjE3I0ys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AUvYYB4WYxO197\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"wK6AXiH45Kxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Dj9bafko31ziK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"FN2wPisUgUIux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"FHIwYNF3aYnNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DkRsEbr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"u0xUZ7Vsv6bIuT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XuXVVyeQ9Vyff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"aqV6rCDVURJQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"xUTdPwgPlw1cBuQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JUdYoLaiajrhSCn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jU66GF3LYIt9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"KU83YENQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0FHIA2bicSeFx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"5vQlIcJ1jM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"T26m15vnlJR78\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"uiu6Pl1s42\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"XkZNmNF8a1j9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kgRv6M5fG8UA4cE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"SLl7LbuG2Xk06PF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"RB1N8AhsmLkU3Un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"BBNAB282CdbMOte\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"4b2Wf7iEMPo6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JdrC3X3JHRI0gR9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jOdmMANA9Ger3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SKuY502YrJ9wOS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"OX4WD8GEkN2XE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"YUAgdfkfhx3a98\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"wF3hFBdVpGzT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"00LxNswJVz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"s3NsFZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"y0H29EzHlZbg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"ZvvcOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"dtOwpjfR7OdDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"lFHP6kXQQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"f6N4jQSWEVoD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"ndc95LENx1h0s4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"zDUGCWLYgiV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ABlTuFtoaU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"ZlLXgAS9u14KH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"19LodIReZUy6Kfn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"uEyTssAJx6q3Dd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"6M7M2k76l8sJcGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"0KXGz8iDWMKeqf\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68bfdae492248194b55421fe7337ea3d026ecfea58146fd6\",\"object\":\"response\",\"created_at\":1757403876,\"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_68bfdae576fc8194bb889eab5046beeb026ecfea58146fd6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":627,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":682},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json new file mode 100644 index 0000000000..98ce0cbfb8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MDghQLOa9Ef8SP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"J1iiqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Oau4B6JxEmVm0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XREOsNieeKVkzc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"h8MM5Oh6LEPK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JssG2JJU2UlIa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"ZcwTDZc5e6UfE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"tSSdZK6HM5eT5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"hwVjSmk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"K4XPzTu96fXi02\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XmSsVF7pI3QTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"NNR0zmu1eORse\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"nquAGq1IogLIiv7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"4DvFvBL2cjNAze2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ZjXw1QhA95889\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"eo3WSmVh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3mRNy9yCTPicK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"L56VhH0OxAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AEbduk6sHDUyS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"OBGVUo1KrO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7GeJqX2i3Vf5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1c71zVxXN3IAmJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"JQ8jamxqyMlpGSL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"731Stwmi2fv8mk6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MOElv7R4zeEzDzp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"WhGcwZFC5nzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"EHJzQ3ULriaCQm6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3irrttjGgaiWy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GXA8gSdHFkp2evx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"fdKa52102wG3A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"zGUgKGK8EPJR14\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"WmACDVCYI06D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ikydh8xgfsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"arM8L3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"88ZnIMtUixtIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"tkK3jh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IPyR2ShYIP1KE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"vDvpVzObl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"FaxuyNjSFf5T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"RIa66xTh0AYn5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"P1sg2RnMojI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"enArkAynNp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"dB1juS8NGtpST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"xjq67P0iMfCUmvM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"0cAUhR188iuO48\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"2b8uwe23vBn9BAg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"oatgS1FzJK0DP2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":615,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":670},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json deleted file mode 100644 index 1c6c109481..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_22cee362389152a9f2eecb273184da49.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uzxC3DUaIW3EYz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"auIYg9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RqexLhzKVhz7n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nUGHIFe3GBVFAV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Xz2EgjKR8j1X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0CeAE3TXYWZYX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"vWS2PlRuWatM1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Gha1KIzvgSkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"NOkobA0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"1zvAWt3W6IwSSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4W0WjTiTV5FKi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"4aA5jVDetPKuA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QciyqvZL9ZjYEyk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"eOxwcjJ9LNEpEnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aIjvtVTdPmcuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"G5RAURwT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"sIxDHAPRMhYDM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"Pj7U2ddHlFE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bhPhA1v9O4adN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"82pAWFY89B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"dEwhi3qAIsyy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GwL49KYjtYloMgX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"A9yFAvx1Xsu3LY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"2ETf6Qx4wLyLdN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"vBV1YfAQ8DHAtV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Gso2Twqc8b4gMLu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"khu967cXpeHDOk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"sjrG99wKLh4J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"T3eBVescUwjyvS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Nx1EBfAmEBIf4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PiGGsS2uaDqtef8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"cvRg8Lb33MJXwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"4EogH2I1rzBfBf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"oen08aLz96Wnye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"9yqRj9VgyOFBH4u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"ndYBnq9dRsfKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"1Fq6XAGhEEta\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"8mnzDFb2PFo8p0H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"y8Zgy4pmzfJKaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"ktcKBHh7fjgN64L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"HPGJu0YAAEImvY\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68bfdae2000481979f03f7d4368b259800f8d57ebca5811e\",\"object\":\"response\",\"created_at\":1757403874,\"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_68bfdae30dac819785752260aac05bfb00f8d57ebca5811e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":618,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":668},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json new file mode 100644 index 0000000000..26c1679f44 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"pGSpIjmviLBbog\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"aB0Smy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"olmgl8K3rrmgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CYGiOG9nppE6nh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BNaAuCMcSypj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Q2YjLgHSSSqF1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"pcHAlHIGDmpKC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SYoYEqWG34qk8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"uuRUZcc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Yd5PVcr0RN3gKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0AK38qIWEhpaN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sZ4eZxTFbVabh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2FyXuJVYE5ReGlE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"05ZqmtXqCRg6xHm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VFeoZuUtED8i6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"tJSgNxE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fkrJ8nQojTMTH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"ZDNrnbeo01H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sSCNVQKezUbl2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"h6wAHDMEQh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"EOzhxQGs1BL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1ILxO6Cta7K5LAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"4bFza4zqyp34zI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"uDAMg75IEPzcop\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"ay6RB5ZJLaoTGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"KnOcPVzzOzey8cR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"OSnWnyKN0jKJX2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"qrAp0J9uJ5R4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"I7BXuLmlDufF7mY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lIPCUW3K4hQoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3T3BsihYr8XqQgf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"fJltwcfIwQqHuy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Z0dpCOS82PyzjB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"nVdBPGKgN8Vm08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MKyWbFTg1lDnm2B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"bDweWwUmHwdj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"8eEEfIgNTEFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"PoHf5G3UM7rpD7S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"dyKd6MMpGUfQ2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"uTqbrkcGZlqMtLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GJWEzlaVd1DRso\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":656},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json new file mode 100644 index 0000000000..6af1ffe0dd --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fMbLkWH8JD5cge\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zA5IQx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"47lmx14CyAzrk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"KQu3PvQtcT2gIL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tXo6ydgEZQmK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"42fcJkXmJGQfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QWe1vx3ase\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TTMzN2lnXabS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"NFReYP1vKCNiWg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SBhqBe3upVLK8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"2SUtXFVIEkA0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"UauHhOyouRzivBV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UqLub97x2LHWCmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hzCaOneyMUk1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"rulGApQtpce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZMU6kxqQ6C1gj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hUmIWWGLmUFDoN3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LrgLC8bJVqHpRha\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"xkSCtvqUxOgH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"KXZzW6Yl5WY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"vSpfEAJFhe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"HtVy4gk5mo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"BinnFLZyj1RkGlV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ZNzqOdqPFg17J8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ftrgiQljiCK2zz\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":604},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json deleted file mode 100644 index 20c807588a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_e907c7a07830a0dbd5739c6647074a6b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"RXkIbGzwrYAak2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cKxeJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"LBnIOFwmuP3Jm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"u59koe1nCwDWMD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"dZp4JHG9bFFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"aP8gUHoqY5Fx7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"hzCpmhOBhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"z58BXEela8P94\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"S4gInMTgd3MYff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mm92qhIIjapEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iK48Q0SKimFJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"nmi4yNu8rOYGFDo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mYL3H3tKz1FLTGk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0XMytAyyNpoVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9xClucSIFIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2nAaBygaaLLZG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"k5W3HHhCUwSFj33\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"lbB9LL6u8grpxG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"5j2T2LNV4Yko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"VChKQ5g5QnV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"MggKsug8Wk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"DJOcml7mdq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"1uPtav0MnREVGOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"towu0hDXASRfQy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QaDIYMMZuqLOMi\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdae7dcd881959ac1f5cbfc5587ef0a694cfa8506df73\",\"object\":\"response\",\"created_at\":1757403879,\"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_68bfdae850c481959c86876ce81a0c4f0a694cfa8506df73\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":588,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":616},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json new file mode 100644 index 0000000000..9b78f6162f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fPzwEycA8B6SEL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"fc87TL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3E4pkFFA3bGOB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"48ZL2nP4Ibqd0i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pUANsD3t0rIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HRacXBchoPMG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"EY714ZimREzme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6r5IjSGzqZubk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DhS3dpP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"EsfAkj8jJcr03l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ND2dwy1oGy3yI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"MHo1gVjSwGsFR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"4uHUe3g4O9CgLxM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QL5sQDODWfLi64c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qusbkooSplxkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"igpt6uuN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fJsJpXX73ajbU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"6WnwTg9OBMM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ceoG9Kz6SW5jd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"UINUfurR1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"bUbRaVZW7C1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"9Y8JeMnn4G0N9Ay\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gmjfQoU1jAwUYuD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"IlX38XWDPLyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"rTIhUy7UqiD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"S4JkrJaIS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"DmkcSb3HgH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3qGHWRJKFkCvDyz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"7QqJsJggN1Qbzt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"zaTzsZjHOKggfDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"9QvJEhVc5Y6vpl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":638},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json deleted file mode 100644 index bbfaaac83d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_833fa6583ec54362359eb3ad3bb7bee9.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tpKPdF6DwcQouD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ouu3dd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"50TEE1m9WkVdi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AhndDzNwmH5Nhp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"lxhdSw8vVl6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Bapf0SJ4N1N2l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"fLrnt3wSc0o1W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3l30HoFMrkmKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"kVhTUVs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"N9O4Gs6byo02H7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wl6orYR03x60e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mm8IGYQoJSV7N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"6cuUcLqr6r9tOAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"SDWuWHWuZN9dJe1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"m982yi59kBEdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"H1iRbx75\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QeQM21H6dqYmV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"l0mNiingPVv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QISr8LmJAXiST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"Luj9bdfnsJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"j6pOB5yijEZC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"63uV9UTSa74ffAW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XYodSQVgyxYwD1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"OzK4YybGC5bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"r1lHoeehncI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"cyB2m8vzSz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"36MGTCZps1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"TD4rV2H5DJVvIzp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"x53f9IccNvTtzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"FJGhvoWcuXeWKon\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8PuSEp2pDyzZmj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdadf6df88197af41223a5b3cdf230c5da1afd2f95743\",\"object\":\"response\",\"created_at\":1757403871,\"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_68bfdae0ff188197a284668e08b3bc110c5da1afd2f95743\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":650},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json deleted file mode 100644 index b8e5fc688c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_8e90c887a5e6d318a269ccd8526978e7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nr9FSJ92vN8gqi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sxl1dG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SZkXyXJ6l21e9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"82EzkMPARYCqG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GohTKdLztDp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uRe6v7GtLobUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"7gk6AoX1Ww9Q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"D5a9nBqBHQyuS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"TwcquD2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"1yNGzACNpqahb0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OpX98fY4WQlB6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"VwfCrOnU6xOMR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lalTKh16P8PkSwY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OtfknEgIccwzSju\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Dj28ofboLPInx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"bgD7LoAP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jpgJyeO05necR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"cLCToMJVWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eZJgYoE5F4mD7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"yfOkTD1W8K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"IM1O4fqF9B1c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hdz1NNaYmqwLohD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FKUtuZPUpeThg6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"LhISTRVHJtTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"uoAAT65a4GL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"va6v6WtY8V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"RluRmgG2MN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ud7fb2tYfbMmBew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"7baX9ava3zMD3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"NYlX7x5mNpYr9Jc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2Le5fTX38hsbzB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdade2fe08190a8508247714525ad006fbd9473fb595c\",\"object\":\"response\",\"created_at\":1757403870,\"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_68bfdadea3408190abfe635f92d7ea62006fbd9473fb595c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":650},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json new file mode 100644 index 0000000000..1e482944ca --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"F3OxvkjMoOvWXO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"jAmDLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"GcNccPnprePhc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FF1wYFBrtlWooC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"MuB7YUtwIE1X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o7OHAUhHNV9p7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"t3j1WJOgFTF2W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NaPE3KKOWwBAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"oq8VZOF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Y0H4gEmPCnLtVk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x6llO2MXlfdts\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"NKLrz8NWKouw2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Yw6KBZ4m3zfbEhq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"1qvLjf2cF6S3D8h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"m8NNbQ0JeK9la\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"zCrzEc1M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"haeu42BIAJi1w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"Pe5PndEFTj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"d5VWQNhQFT0xl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6Ylbrq5FiK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"TN3O4VeN1PRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AKL1JqaAgnudIrL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bf1wEfYGiXELUVh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"QQo931nIs45K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"EWjeSHWf2PG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ucmSbr3N5g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"rsKzKzTB3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"aUm1UZRPUhQDGQu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"CuOFhoD8PgMZPG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"i1oAIkoKDt4diw6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"yxQM3H2xPn3vkR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":638},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json index cd54bea693..d212005284 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_ca56902b9fb667cb5dcb65b96fbabbf4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

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

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

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

Hello, world! Bold text. Link.

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

Hello, world!

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

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

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

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01TwbmNfzWVBFqWJwmDXekvY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01RHiMNouTSdZeDNj63Er78X\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1203,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":118,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01Nw7o5pKqFdUjR1nxSNZcKd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01WzDyHn2iWzgEsejQK26zBx\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1194,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":118,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_33755207ae3d7cb4fcdc044d1ec10ce0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_33755207ae3d7cb4fcdc044d1ec10ce0.json deleted file mode 100644 index 35e885d308..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_33755207ae3d7cb4fcdc044d1ec10ce0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01ANJGbbfUGenjKa4prHhttm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01HYFVpRk76rd64SexiUoxzV\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"},{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1024,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json new file mode 100644 index 0000000000..231d1d35a2 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01QndZovFbNoWL6mRUfLNdNZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019CMoWBZDwf8i8iv4taHm52\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1013,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json new file mode 100644 index 0000000000..e85a3d7460 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0f62143fdbd77bce0068caddee0b5c8193981f12dfaabee590\",\n \"object\": \"response\",\n \"created_at\": 1758125550,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0f62143fdbd77bce0068caddeed32c8193874c4dae746665f1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 709,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 765\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json new file mode 100644 index 0000000000..592af1e5ac --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0a5e47995f5782a40068cad8a8eea88193be23419023cfdee6\",\n \"object\": \"response\",\n \"created_at\": 1758124201,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0a5e47995f5782a40068cad8aa1f8c81938c04261aa1740a17\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 543,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 597\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json deleted file mode 100644 index 6290fcd7ef..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_d94f274cff2542fe1b248e007753da77.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9f25d7881968b72cffeabceff530c3a6e0042a296bb\",\n \"object\": \"response\",\n \"created_at\": 1757403634,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f30bec8196b42eec4fb81d721c0c3a6e0042a296bb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 557,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 611\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json deleted file mode 100644 index 0b431339ab..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_0c06e1f34af80242cc3dc017cb7b77f7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CJRe5lvCc5ecC4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"HmiS3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MpJl7tSvTKoGP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"07vKYZlkCnEkXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"whMjTPjnN1FX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fjpnF0rcSsNhm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"e0RYVdHKGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dm7PKPepFUzTc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WilJnjGkFfrGcN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zbNwcqUPIrd23\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"s9sIaI3OR0lII\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KXmuNi5b9QIKxuv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"p7802PRmt2RMbV3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yPSrx56FCT0Hp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Uq8NcY7DMGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ezGzUm9FqaGsm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"7XZrXWOFIQtOHC6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"aTNFf4q79oGFZYp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"P0U13bUs3V1fN72\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"ctlYtF2mcC3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"cMWvgX6Tp6tM7Na\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"GNvo2XS3f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"PYhwsnun8toLom\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"Pj6GThphJ6Rm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yK6LtaBwoV7w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UF0RrVBJCTrfA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"TPWY7GjKPZAiy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pREcXPHbLztDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"IsYYkNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"djhfvZ7JWdviYn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cK9kiYEqbiuiI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"x8Rq6FRgCA8ye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Q5LPLRaXye7ngHs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5Fx5kkniSskXCqU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SEEamXu54Jcy9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"B7HVPkZO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KsJTDxS0ZHFnX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"Ew9Jpa0127Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"j7qqHFRkJ1xB4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"oxdLKgJV4d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"PG28mFKhfITZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"V5dRORALBGRBAJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yDVQCSMxKHNDq13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"444pPRavThQW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"HzgrVnm4RxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"jEvffau6bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"SF0Nbl89ok\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"RbxUTqeg7UL24JT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"BwbIrVQBoicLnh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"FVkvdrDuicPSt6t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"LSFP07tgFavRtV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68bfdb01c8508196a379e4ad7a55c2df087a00285fc5dac8\",\"object\":\"response\",\"created_at\":1757403905,\"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_68bfdb0254b08196a7b79918ef963b94087a00285fc5dac8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":721,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":777},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json new file mode 100644 index 0000000000..f3705fb7fa --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5b1K4AO42WRnIt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0UdyMz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"tzj8d3IQjsuYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"H3cb2RUdw1BEOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UeXigCXkGkWm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0vfWoScJxh7qA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CxRHSQSRIn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WuDaA3od2Uflv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Ar1cN4JypXIx55\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JzTXfcZWBMcKh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Wj2slocjtFW9Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WOFoEG5nPYMDm6p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"XtXtNt1xyY6RwsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yPk7ac1xzMDBr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"otZxFOXmHYl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EyeTSng8vMYOJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"s0TmIsnIgk4eaUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yv4ZI1TNXAUhKlg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sDcsyqhxRB4vPIC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"zQ2fFSLkSCy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QVDge2VBBNN2E7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"QOStoIyrn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"l4iCOipvh7A4Kx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"TE0FakS3yCYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"SBAe0QPBYF0n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"g0rxwaEzik78b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"qNsKyKBUHJYIy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"f6TX4F9zn2ad5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"WsXoMK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"jB6WctFI3osQhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cFQHLslTNMkCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ce1SBNv0JjH0H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"tTnEA5hTDTM8upo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"9TTBaH9KDP71MSk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"CUqEsu46MGqLz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"2IPcR8Q6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vtdaKUgm7o3zp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"OFn7RuCWYfS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2s6dN1FwcFx3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"xlGYtNASoz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7N7ZzFRSLGrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PvvCw26tw2H415D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SjqZ4ymTIgNhn77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"dsmkLFjH1Qn3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"RFTZrtpchvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"EulgmQb36Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"7DOp7I1RZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xraml93e1ueCdXf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2aWHHwSWqCiCXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"0aHpLxHfhGtAVsS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"DNqRBazAfX6Is9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":709,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":765},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_6a59628efbb4af73805eb2359a908f14.json b/packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json deleted file mode 100644 index 6a5440fec9..0000000000 --- a/packages/xl-ai/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_6a59628efbb4af73805eb2359a908f14.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TqZ8PbIsy1G54q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AnnmKf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Vk2s2gOqrfbE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"98gkVBh9rkxzvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S40Oq3QsdHhf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xzJfEo5CRevOj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"p44jpCrxT5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qEhxbi8yz61jd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"V7Oz4WxzGFPuJL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"R8Wb0Kdm6pXeZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"uQwpRUIYCBtw7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2ndWV3dFJlPXDLm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ekqaXGNna1W4S2U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"h5aGnjAEtGY0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"o1FNjr7BLiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iyj2cvycToVh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ASluxTIzbNVSeas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"mMb83FH6j1wHb0f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"bnpiY8LBYbWRtW0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"tiEYT0Zfkcw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"VP5JM0Xra9oUxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"6AnuvHfwVzPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"K6efGl0EYWkk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OcewMTOecpPzT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"sWC0eMWrCSYFb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uZyaxpjasvGS2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"ZWpZLcB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"sA5dfLfnFK9QIi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OUJuoWnOaW9sp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qG4uNbFflnwyt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"scIAW5s6ncuLlbW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"xJr7tUpzqRTqIme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qNyOuqaQsSkH8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"AAOWxuWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2fdSFYhoibxI5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"pkWUPVsXAn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sNQdhQmQSKEAu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ZG0UMvzncT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"NgIrQ4nbUJGf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wpNIJIChsuT0ySB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"px5mHifoRweG1Ky\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ZSR2wf7aY1Zg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"kyd5PBggl6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"0S8Bph6Ad8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"SKMH7P6OMl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3SceOr9zYVrG7RR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"pO26HLzLeNIamJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"t9Ps8ikT5WtMybT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uTsaX5CbVYmtum\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68bfdb0342bc819784fa4f834f40ee36027e383c6c7c0282\",\"object\":\"response\",\"created_at\":1757403907,\"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_68bfdb03d34c8197b06f0c886a56c045027e383c6c7c0282\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":557,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":611},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_837eb32ef792caa67d1aaa4f9b7d7b91.json b/packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json new file mode 100644 index 0000000000..b92a3342a3 --- /dev/null +++ b/packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QdAI1iUuCbk8sn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"4E82fp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Z2CYSgNlUqDfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ktbTzB1EsAzutq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0Nc73JjL2doH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7NZv1Ig2QLexh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"NeMZbnzuUIfyZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"n9yW6nlLDRNIk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"soYDDU1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"o1fK7L1QWjY6Cp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fXu6BnEmbTqPr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yBuZZyyia2z2O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"pBF1wHyqoIvLzfw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"wxtcMm5oLavyrqt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QNT2a3bb9R1GR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"wFWPJMXE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2jhaHtaJiOqeF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"cmHqpBDufr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"btnE2npz8TVlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"p3tUuGKO1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"IhN1bdaKzy45\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"JjmZOrwg69TGStM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"BIOmy6pjQOJRF40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"36vYJVbBMq7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"KYqDVbPplaA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"gZK4cmnIkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"YXLogjcjIE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"81Fhh3OJL1wD5bg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"04I6xAE1q861Rt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"xN3WqYHXL7ea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"CHP2lhXsHLsy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"F97wt8UCNSAVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"KnbDX6YubI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2wtgEc3cVU2LI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"P6C5B0M79Dk88D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5EhPpAKU1TU3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Zw9uOvsr7ws4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"M8XFAXvgcPhXTjc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"63uJya1xgMT6vME\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iT1hRcDhVUFkH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qYusuOY22kC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fpklYNwriN0Up\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VA0rpEnXVhHzf6e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"kpKdTBB52VzVL26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"basfOdfIdYXSInc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"dJ56lkZSxpS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"pFLqp8u3FGyG0or\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"JI8EhyO7kq5ZKM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JZ62bTb2xki9H3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":543,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":597},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json index 047e691da7..61cbe74052 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_046ddae2286f36597c05b53211d9b18f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01UPpHHpfY6KSEAGfe9EBKzN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01CxGh8XArnerzQusvzpzW72\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1179,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01CYMseRP8sPeMmq8dPsoYez\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01S6332VwjaYcRYJ3FDYmR7r\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1170,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json new file mode 100644 index 0000000000..9f47be22e5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_03a50c2aefe1a00d0068cad8a4903c8195a5e44900b915a100\",\n \"object\": \"response\",\n \"created_at\": 1758124196,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03a50c2aefe1a00d0068cad8a507508195b2aab7aa8ed00dda\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 686,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 702\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json new file mode 100644 index 0000000000..7f3ef73bde --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MVdbKRrO4swuHQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cW3NDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PN7AtNhPl9hYW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"x8yWBe8g0Z70uw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"OG2boREBVIEF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0f5oxuz8lUcEf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"UfclZT9kn8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8R0MCLzKUqPgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"k10CkT5YaA2gxe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1hooRlAt8IXmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"6vUqIRGQduVXX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xytkTqoKLf0nyBx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"J6xeHByI1vCPqwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"wnGmUh0LzhROTP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"H3cuIagaDex1DL\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":686,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":702},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json deleted file mode 100644 index 668d073656..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_841f6c175f84f924ec16a526ad71e33d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"V7gqh8Iyw79srj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"WQM02z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"TQdoj4qpXDgYX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2KCLRQH4yG9xfh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"7yzgggN0bI51\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eSk86oWsy3CV7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"hSlkjPPSyR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OHGirNLgJOQM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7SiwmPv5VzaroI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LPN2oNkmvgMs1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"v970cuLl9u9S1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"YxCLNNxC2Htm4Xa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"tfMIdrOtYp6vtsF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"fdSeDfJEfLd2h1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ySuRcx1EcZCGO8\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68bfdb18d3488195a2b786bda98be99a052061d2b4c02086\",\"object\":\"response\",\"created_at\":1757403928,\"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_68bfdb19427c8195ba52d6e568df4553052061d2b4c02086\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":714},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json index 9b0a39ba1a..9103f3d595 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_c5d2e868457afbd1a279bcaa2e18c7f2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01EsjyhyfSAUo8u89zMgHEbs\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TiHVtLpBC9swPHSpLdrbuW\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1199,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01Q8BRUShduuvLr4BtMXmmuA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016kg7AnqxNzBt6Dsr4ZD92y\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1190,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_36ab57c33a9b92cce12bd3cc2338abca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_36ab57c33a9b92cce12bd3cc2338abca.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json index e02f24c876..df307b3056 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_36ab57c33a9b92cce12bd3cc2338abca.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_014UPi5NTzvqJkWXoxvTMAhJ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DgGMtLXTSdcY3K6Yu2XAu1\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1192,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01Y4wsxmdBRbXY33AZFo2hbr\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01EwnQELvG78Q4tceLYmze2K\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1183,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_880bc2c79fd0a55606bc3d4350f3f61b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_880bc2c79fd0a55606bc3d4350f3f61b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json index f48c99451b..fbe65624d5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_880bc2c79fd0a55606bc3d4350f3f61b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Py44c1UE17KoqYNL6v5NyR\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011FDN9jgayDBmhQbtuZvrQQ\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1063,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":60,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01UzPDZDmswdSqWxqdcWofhX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019WHr5saVmw41EZT9A2CLV1\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1054,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_349b95a48f92584763e38280366e849d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_349b95a48f92584763e38280366e849d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json index 2891b3ef00..aafad14e14 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_349b95a48f92584763e38280366e849d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_019gCV78pcCqYK9AS71qqPWF\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Tm6ATTG8ARSjcj2gaVpaXx\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1064,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01YTcYSN4vGyoLXJgTHAn2d8\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016H1Zipt6cZy5bginnwV4NY\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1055,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_8db7582d172169c8d97fa66df3e6f95c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_8db7582d172169c8d97fa66df3e6f95c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json index 8b9bac042b..662054c953 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_8db7582d172169c8d97fa66df3e6f95c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01C95QBQcLE77iF34YG1Toqn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01GEsQDNzaemefvce36HKZqy\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1191,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01L1d6FvK69vwt2anSYGXd7Z\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FfS8yQEHqFSLfMtbZQBxye\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1182,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_5385a2da1c45e1622a45a76f939b6add.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_5385a2da1c45e1622a45a76f939b6add.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json index 72ec56de57..5e7cc38c49 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_5385a2da1c45e1622a45a76f939b6add.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_011woHEWexYkCwij4bxevJPt\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013B9TobwxZL2hTwD1b3zAs4\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1181,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01DyY38y4gxK48LmPQx5XRdU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012xPFz8KtD5fkwGmemzHJmt\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"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\":68,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_55d746e02a3178b820afabb3af591f99.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_55d746e02a3178b820afabb3af591f99.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json index 597c769df8..6ebd64981b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_55d746e02a3178b820afabb3af591f99.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01TUyqWu9XqdHZcjnisNqEco\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01RWKnPmDbycwPxftHeFyogh\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @John Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1183,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":114,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_019DqHtdJLG4a6vhX4jcC9QC\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Sw5iyZ2vE7orzNcBypiUK7\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @John Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1174,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":114,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_e73d0ee5659f2b999842cf3cde2a080f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_e73d0ee5659f2b999842cf3cde2a080f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json index ff4e61f82b..234fa02bf2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_e73d0ee5659f2b999842cf3cde2a080f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01RE4gtjt2ZteqScBS7J9UHD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01588Pt6G2M1iUYLeYdNTMA9\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1200,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_0156SBYqywkbVX85gkMH3zQj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016qpHCM71ThfDh2QuxRobBo\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1191,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_291012f0f84823dcb3048ae5c5a0a5ac.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_291012f0f84823dcb3048ae5c5a0a5ac.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json index e7fc40f8cb..8c1fe6410f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_291012f0f84823dcb3048ae5c5a0a5ac.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01G14zXVtA3Vuw7TVPQ2BrT3\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01JXwKUfod8FJQgJ8uwdAGUp\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1190,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01R8ZbuB1QZ6TYnEQHMJPDfF\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01GkpwVXhEpm8KonwqeLw1dj\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1181,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_64a1abcbf8b188a770f1148623bc68d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_64a1abcbf8b188a770f1148623bc68d4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json index 2a608beaf8..57ac0baf27 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_64a1abcbf8b188a770f1148623bc68d4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01BhdLFXkLqCKB4CqkPgDvgQ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01WaL91MTXGzXg8YhsZWBSEp\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @Jane Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1182,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":120,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01LC4YS2uDRg8WJo7WYiVVJY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DYdkZQLSrbKuGuskAxDpFN\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @Jane Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1173,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":120,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_7d353e20ad801e6e45d345e96068902e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_7d353e20ad801e6e45d345e96068902e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json index ed26ccd710..4d67f4006b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_7d353e20ad801e6e45d345e96068902e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01BDAHtPVc2Q7aPEe4W76v6j\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01LpoE1kbmTx9LJvBnE2TG1d\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1193,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":126,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_013T3Wfeeu9tAKGHuB35rqHt\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Q72Jd6E1AwQkPcm2nveP5c\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1184,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":126,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_65069ec605ef6a1bd8d2aea501d9478f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_65069ec605ef6a1bd8d2aea501d9478f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json index dbd63608e1..20edf6c0d6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_65069ec605ef6a1bd8d2aea501d9478f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01X63hFaTmj7LabohQETByQL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01RHCQqSxNhSQA5i3TQxWzEz\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1179,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01QwphcuDLmyKtXonk4r3ghg\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FmZWURVsZ6a5wkrAQVT6VR\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1170,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json index 159ec9520c..f511152728 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_cc4d17d0f4af7f363b5b33f2eab322ad.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01HuRDt9vYs3PznKrQrjQTui\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01CeP8R4kNSzazWyQPS7LmRX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1187,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01Gw8pvwFVbtaAhxAmPjs7Bj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DAZNBRj3Voq8H8afsXXccU\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1178,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json new file mode 100644 index 0000000000..e146c2911b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_013FegBEP9cn4JkS7Kn8Ejnq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01X2ht322mUughqCbRmCzRLc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":995,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_b45440e84c9d81d6dead47bd37f8c771.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_b45440e84c9d81d6dead47bd37f8c771.json deleted file mode 100644 index a658728534..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_b45440e84c9d81d6dead47bd37f8c771.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QfK8E6UFFUDaNKBACDgbLK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017SAmKyha3KH5hzD3KrUMMb\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1006,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":66,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json new file mode 100644 index 0000000000..56c5c6aa1a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01Xc8sPBayyZajgeemdHDVXK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01En9MvgKWpWNRk3zvMJi3TX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
  • Apples
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
  • Bananas
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":924,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":110,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json deleted file mode 100644 index ef5a4ebfbb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_71a8ef900853abac07443ce40a054680.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_015pgY5URt7nFwymTbDitEAX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01S59YsYHv3ng5puB9NMQF4n\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
  • Apples
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
  • Bananas
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":935,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":92,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_4e119094b2f0d01391ba2b29c1b0e3eb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_4e119094b2f0d01391ba2b29c1b0e3eb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json index 668b09c659..531bf50e7b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_4e119094b2f0d01391ba2b29c1b0e3eb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01BsX2y1CYRUTGAbFgb4UYND\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01JVoQiEj5pC8mzbm7skxiWA\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1194,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01Vpd9WNn7B82MsWT8z1tq23\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01WpwBEhfywBdWgeTEiPfSAB\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1185,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_450063cb74b46323a73d507c480d2b08.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_450063cb74b46323a73d507c480d2b08.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json index 4fef2f9180..625ed00bba 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_450063cb74b46323a73d507c480d2b08.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01QaxY2ggCwNQskGZy1pcHCc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ApM24nXdgzt3hvgM4RaWji\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1181,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":66,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01WP6HSxkakh57sdDnFxm3dL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013NBHoE5UrvQSwKwfyaMcDT\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"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\":66,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json new file mode 100644 index 0000000000..2c893bf088 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_06c09a347fad78690068cad89ca6d48195977d2f166e2b34a8\",\n \"object\": \"response\",\n \"created_at\": 1758124188,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06c09a347fad78690068cad89d338c8195b83e27e02faea2e5\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 705,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 739\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json deleted file mode 100644 index 1b27638c27..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_3c75ece673f586d1fb428c4250e9726b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9e914bc8195bffe916aaca6744206c251dd6c269d8b\",\n \"object\": \"response\",\n \"created_at\": 1757403625,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e980c48195b1e75051c1ed6e2906c251dd6c269d8b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 711,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 743\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json new file mode 100644 index 0000000000..91efd08ed6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0c48a09e55794f0d0068cad89ab9bc8190b499857f6581cd4b\",\n \"object\": \"response\",\n \"created_at\": 1758124186,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0c48a09e55794f0d0068cad89b8ae48190a6b8dd99b4e3770e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 699,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 731\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json deleted file mode 100644 index 1bdb789e99..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_e101f067bae31019754a533d650420f9.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfda91e5a081958a8ff00e450aea940a016e56b1ec57d1\",\n \"object\": \"response\",\n \"created_at\": 1757403793,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda92519c819594ae83cd89dff4770a016e56b1ec57d1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 602,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 629\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json index 2a2835f2ee..3637958b92 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_e584b7787ed790b5453cf3c5410f5e3b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfda95faac8195af25603668214901038f9be73ff7e1ad\",\n \"object\": \"response\",\n \"created_at\": 1757403798,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda9690c88195a186d1cd11ec9a4a038f9be73ff7e1ad\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 702,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 67,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 769\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_08c893cb5be25c9a0068cad8a047788193a7030c492c152c9e\",\n \"object\": \"response\",\n \"created_at\": 1758124192,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08c893cb5be25c9a0068cad8a1aab48193aba5842ea9dfc5f3\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 590,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 617\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json new file mode 100644 index 0000000000..f3bee55fae --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_06f47b9cc91eb8f40068cad8a2971c81938b542d3e9f37abdf\",\n \"object\": \"response\",\n \"created_at\": 1758124194,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06f47b9cc91eb8f40068cad8a36a3c8193baedab76879295e0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 592,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 620\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json new file mode 100644 index 0000000000..d3e7eb5aff --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0eb03b8244e623210068cad89617d48196a10307c7f1caac8f\",\n \"object\": \"response\",\n \"created_at\": 1758124182,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0eb03b8244e623210068cad8970568819681f0d869b96b2ddf\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 697,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 744\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json deleted file mode 100644 index 3f9c909de6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_c126a42e416d569f6a46d8d62a7c83c5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfda8e91688195a215c45d612b4fdb0642c56ebbcd0dde\",\n \"object\": \"response\",\n \"created_at\": 1757403790,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8efbf881958ab21856700c58ac0642c56ebbcd0dde\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 709,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 756\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json deleted file mode 100644 index 2aba3cbd22..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_59cc07c257b80b03c8982433551e5fda.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9d0e8cc8190a47a23c7951f0ee400b8ecbf69e8fc92\",\n \"object\": \"response\",\n \"created_at\": 1757403600,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d15fcc81908c11dc04b9a13c2a00b8ecbf69e8fc92\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 728\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json new file mode 100644 index 0000000000..bb1654f5ab --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0f507a41bf381a470068cad882ae948196aa61d3f12743f40f\",\n \"object\": \"response\",\n \"created_at\": 1758124162,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0f507a41bf381a470068cad8831fd08196b6b383a085ec9593\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 716\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json index 88e886293e..c4ebd65a34 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d41aa8c58e29f2759791b16e2bacd02d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9ee939c81958dd8c0594bd760da0d2ae83ae0da4c14\",\n \"object\": \"response\",\n \"created_at\": 1757403630,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ef16b48195a0b94a368b4c09a40d2ae83ae0da4c14\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 632\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_02344721644696360068cad88ce600819096c9dde6ae427e19\",\n \"object\": \"response\",\n \"created_at\": 1758124172,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_02344721644696360068cad88d7e288190abccfdbc6eff88fb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 690,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 67,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 757\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json new file mode 100644 index 0000000000..3d9da486bb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_049ec82e4f4af4ee0068cadd62aa288195ba75165ebc230496\",\n \"object\": \"response\",\n \"created_at\": 1758125410,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_049ec82e4f4af4ee0068cadd63774481959f94431ba96a0043\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 706,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 756\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json deleted file mode 100644 index 87b05669c3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_bf143f40a5064e08f776cb104a132cd5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9dcc7088194a080d50f3eb3d2f40dd74cc9f1ab9d11\",\n \"object\": \"response\",\n \"created_at\": 1757403612,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9dd34fc8194b898781e57b864970dd74cc9f1ab9d11\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 718,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 768\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json new file mode 100644 index 0000000000..3d534417ef --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0dda6775b6f8ed8a0068cad88928488197bd7321ee04c1aa7d\",\n \"object\": \"response\",\n \"created_at\": 1758124169,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0dda6775b6f8ed8a0068cad889cf34819789ab3a58abc6c98a\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 696,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 724\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json deleted file mode 100644 index bcef2623eb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_f8ff406bd3b389d1c2a77bb991a80206.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9d7a69c8193a8d3766959f805a703b20afb3e81a3c1\",\n \"object\": \"response\",\n \"created_at\": 1757403607,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d88f188193817d870a87230c5003b20afb3e81a3c1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 708,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 736\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json new file mode 100644 index 0000000000..bd459e0af8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0ce242f49a1248290068cad898f5448197a020be19df99072c\",\n \"object\": \"response\",\n \"created_at\": 1758124185,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0ce242f49a1248290068cad899883081979ab6b2839448e525\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 72,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 760\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json deleted file mode 100644 index 67da0777fc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_783882c6aae6d65c404ce0a7d41275ef.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9e56f808193a47f462aede84cff02097290c49c3e34\",\n \"object\": \"response\",\n \"created_at\": 1757403621,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e5fcf081938b1ba1b94708f4f202097290c49c3e34\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 72,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 772\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json index 048073c528..a61e3fd0dc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_6a7146e1ef0f21dccfee7de3da9fe76b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9f0d5048193b9600926cb2d2d14064b14b3d7b82cc0\",\n \"object\": \"response\",\n \"created_at\": 1757403632,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f131a08193bacc0631f7bbce65064b14b3d7b82cc0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 721,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 777\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_03298117791523fc0068cad88ab83c81979abb7d6b6c375683\",\n \"object\": \"response\",\n \"created_at\": 1758124170,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03298117791523fc0068cad88b4c308197975fc7467b4f1d63\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 73,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 771\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json deleted file mode 100644 index 01172d3c5a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_71a7599d18815777e331d4a9db56d39d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9d96df081978216a783f8a8da740acfa2bbb605b6dc\",\n \"object\": \"response\",\n \"created_at\": 1757403609,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9da03348197a17fd16f14e3bb820acfa2bbb605b6dc\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 710,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 73,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 783\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json deleted file mode 100644 index 1275c241a0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_83e8c09f45e23e2dce4865ab7687a636.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfda8bd5fc8196a0b4cfb0be562be50626755b23e2aa86\",\n \"object\": \"response\",\n \"created_at\": 1757403787,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8c3be481968fd262785e01380c0626755b23e2aa86\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 729\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_8d2db5980d3b724a694a7b9ddba8d6c8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_8d2db5980d3b724a694a7b9ddba8d6c8.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json index 089c905574..6dc8df33d8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_8d2db5980d3b724a694a7b9ddba8d6c8.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9efd40c8190bc3bc916f533801b0ae51576d4ae2da5\",\n \"object\": \"response\",\n \"created_at\": 1757403631,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9f053748190b82b1ef212e6cd6a0ae51576d4ae2da5\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 714\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_0ff24b469357d37b0068cad893af6881978523dd3edb601d5c\",\n \"object\": \"response\",\n \"created_at\": 1758124179,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0ff24b469357d37b0068cad894db6c8197be8b164c3cce4633\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 686,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 717\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json new file mode 100644 index 0000000000..52f3395dc4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0316ac59e8c96c4c0068cad891c79c819398832b9905c08ce2\",\n \"object\": \"response\",\n \"created_at\": 1758124177,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0316ac59e8c96c4c0068cad892e488819383c1a6e1ecca46cb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 693,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 725\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json deleted file mode 100644 index dfd711ec4e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_d72e1057215df948279c33e394e182d1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9dfd6988190aab4ecc4baf449810b8a3960293a0b20\",\n \"object\": \"response\",\n \"created_at\": 1757403615,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9e18c508190b96a7ae0033607a50b8a3960293a0b20\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 705,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 737\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json new file mode 100644 index 0000000000..cfe58f1e9a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_08aa32ed72bd7d390068cad883c948819481a72e25e21e1820\",\n \"object\": \"response\",\n \"created_at\": 1758124163,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08aa32ed72bd7d390068cad884af448194a1fa1cb6afe37b87\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 526,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 552\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json deleted file mode 100644 index d89bd53f07..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_601e089579d3047dcb2dc62e943d20e9.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfda86e1dc81979d461e1821e682140653c55214b0d494\",\n \"object\": \"response\",\n \"created_at\": 1757403783,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfda8840a48197bcf50df973728fd40653c55214b0d494\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 540,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 566\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json deleted file mode 100644 index d2f9584d63..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_83697ff9e8b68ed3b717427d1f615fe7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9ebd0808195b6eb9eb4ecf68cc1008a0452007e913e\",\n \"object\": \"response\",\n \"created_at\": 1757403627,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ec560c8195b84c1f8045bc4cf5008a0452007e913e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 486,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 542\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json new file mode 100644 index 0000000000..e8573721ff --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_08c1f3a3049c36af0068cad89e447c8194992f2d725fc985b2\",\n \"object\": \"response\",\n \"created_at\": 1758124190,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08c1f3a3049c36af0068cad89f2be881948f746f206562aa48\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 472,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 528\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json deleted file mode 100644 index 1e6f45bdde..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8677e4e9a17acfed4aef83379790b198.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9d6400c8194a7ac4b6f717e35d40c43b7132c1a4d43\",\n \"object\": \"response\",\n \"created_at\": 1757403606,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d6b64c8194a6c4ec8e9f133c370c43b7132c1a4d43\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 711,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 742\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json new file mode 100644 index 0000000000..a6f68730d4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_0bc74b446ffc0b110068cad8878b788197952b8c84ecf4739b\",\n \"object\": \"response\",\n \"created_at\": 1758124167,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0bc74b446ffc0b110068cad8883fa08197898d468e5e94655b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 699,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 730\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json index 03841b8e63..041f19cca7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_ef92e6bf643d95a5bcb17a8baaed3ff1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9cc2ae08193a68d28076303f2d80664d01c7eae33b4\",\n \"object\": \"response\",\n \"created_at\": 1757403596,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9ccedd48193aaa1b8cfc6cb50c70664d01c7eae33b4\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 627,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 682\n },\n \"user\": null,\n \"metadata\": {}\n}", + "body": "{\n \"id\": \"resp_06845d3ec8ade7750068cad88643a481978d0262549c3301c4\",\n \"object\": \"response\",\n \"created_at\": 1758124166,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06845d3ec8ade7750068cad886c2988197a7f85996014a6ad9\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 717\n },\n \"user\": null,\n \"metadata\": {}\n}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json deleted file mode 100644 index 988115fba5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_d2ed2696edc4763285392fcd631ad144.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68bfd9d55f6881969d329a9f079a891c0dfe90ef9d6eee67\",\n \"object\": \"response\",\n \"created_at\": 1757403605,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68bfd9d5b9648196936f02920766e8770dfe90ef9d6eee67\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 700,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 729\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json deleted file mode 100644 index 11970c7866..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_64adc98ca4a79fe75565cf984f6b9ee6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"1ofGhtQmfxzMOb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sxtBfN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"btZE8hhaNiuO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SN5SpVz1YuLoMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"YtkJbldOvQwG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PXWmhJhwsq4mN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bhIHtaPb7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"X4HciK3cQnHOz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OTY6P9lY8KbJHA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hH69vpcBgkg8j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"o57ts1nESao7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"GHgvIzv1NAWgLJp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"1jBP0ylwtNZSszf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eVLkbC2q1YHKf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"UIBz6B3Vdbo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xNpKeP7PTYIe5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"BROjnw2SQglVmVN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"jCuwNldoJoIGxxc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"187fjYqR3aiPesS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"aVMehd4sC6ORbB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"yIH6Z7fCK5cDdpW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"aEU7sRPN21\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"2rCxAnN8S83Yvlc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"9pjEH0WWxzw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"oMJEZmFNULFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"3DB2AyQb3SK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"DT3uSwMpe23rP4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"Nejzt6KJ8f1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"xwjmUYCeEJ1Z8bU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"unolH94ZHh3KLM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"CDPHguu9VG2ozl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68bfdafc20308193a140159290878c5504be5f8d93d40ab1\",\"object\":\"response\",\"created_at\":1757403900,\"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_68bfdafc995c8193bdaeb4d73bf2d8f304be5f8d93d40ab1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":717,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":751},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json new file mode 100644 index 0000000000..ceab078b14 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"r1Gvgh1LiG5C0r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yEaIlQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"XkE2QIygifvId\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EMm2OItdxeB21R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1XxymyruxEoY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"y9ILS1TpuiEoM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BSI0SWoF1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LvTtfdd0tvoLU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UzvfsdkDiTDTUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hC2z3FMEKzQy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KFXeypGlb7zr5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"RtRACwgXmUxdWTb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"AWwfQj77nsHNDwJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WhAO5HkP1Tic7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"lKM5YPkUENs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Hwpk9nOwyU31Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OKRmDTMIptjCM1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LESIp9Kqk0z4CIt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2A82JIcCyExcHbJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"gDJMEnuw2qsXST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6N5oUUoO5Q8BXeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ub2u2WXJPC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"191qmlofL3EnAw6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"sfQjI2H4bdB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"mpmQueXOFGcD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"vb5bs7UXimd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"4FgQlhx3YV47duG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"IqJIvWPqrNH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"NOxuXufR9dHz9mp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gv7IquQIwO1XT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GwdUW4z60F1HJT\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":705,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":739},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json deleted file mode 100644 index a4574487ed..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_59fabaea832d26ec8ec8f081c7a529a4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nRh2hbzRFTq6q7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pbBcLH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"B7RJtQIN9CibD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GgCAwSwg7uNwk3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"heC8tW4J7TN5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Xn4pzE4rucL17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4ASHZr5AZd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"FmeOWI4xwrLgN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"JipbncuKxnVS1v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"22Ejut0FMqkKb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"xm681VWZ7wqv3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"jDiYMMDZn6v9QzQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"II6Zz2JB6awgP8n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LFKJpCiQirkL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BI7OSoLsMy8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WYMGDVrIrCif5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"P6fcLnhXR0RlZwT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xjEzBbbxjbbXYJ5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"SAzWwOAtbt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"fQ0Smq6LRWwgV0b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"oXqFAS3Eoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jG7kFhuyXorEgOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"rdBjnl6WVXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"4wbSuH816Bb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"8NCovq6840ZKaK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"bhuvHUCBQHy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"4x5dmpbj7MDVQs4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9uOZ44Mie5PIJv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"lVKt70jNj7UAyA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68bfdafaa18c81939d5ee3af77b4eb8f0d8cc721b111a00d\",\"object\":\"response\",\"created_at\":1757403898,\"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_68bfdafb41788193a65fcf930cba66720d8cc721b111a00d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":711,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":743},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json new file mode 100644 index 0000000000..40405c0e8e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"xde7UUO9vZJN0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"UCqt8z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"eiHQgmi21tgbf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"19j1yrTban5xdv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"G3R13HbrVLz0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VSRqGNh1mRmCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"2TFKZzR5El\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YgYRAH9hkG3Z5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"EImzPzXBquMY9a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"lF1owcjNQ3Nnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9lJwjRmjykLec\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YTYLjaYQMRZBuyd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"SQBCy6Z1gJyXTNY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vWgIvoR83SRJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"huEyBuCrk3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jr5ppyaoetwvJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"na1F1CGZFKjVg1n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"KmNnTRpnJKcTU5U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"10RfQpZf0i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Gtc7ruci23itM7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"c9eppzAKGL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"wZK7MeV6vc6vL1d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"gWEYMKKMZgq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"aSarmqQSdOV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"AV3BV6gKC6jbPgt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"Rjfc97nwD7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"EW3vpFSrtvqGwxu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AtjbTjo09U9Olo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8ltUfVJwhzuvWL\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":699,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":731},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json deleted file mode 100644 index d2918f1df0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_2fcde5df596501a21514fd6c781016ae.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8lViGS7rhjvyPJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JL6j8v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0rwoVFo3rLFVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"556Uyx4PxBNsUs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bIRBDabETfT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"as0drDds0Af49\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"1vIqKZCkdn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"A7RnVuC5J1hjn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0ExqZ1ss1vKgBe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WVY3HHNaZz4yY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"QP5UnfR0GIFw8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"dNXTrmyZh8xYXMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Owp48NzJ6by3uHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jDWlv0s7XTReg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"O2bzvNLSn6t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iuvIQotrb2EF5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"0iARQMxbt014hks\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"1yjX02bAdi4ZxPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"IvEKqbvrMIFZgQw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"fNSIXUJ6lHwoK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"VJViyNGfAj3Et\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"haelJTZMQIDa67G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AvdUjqsJff0yHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"IlM29NM4zrphn7\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68bfdafe7098819480a27de59ca499bf02f00d77c8f87b9d\",\"object\":\"response\",\"created_at\":1757403902,\"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_68bfdaff192c8194b35ffbf9bfcd825102f00d77c8f87b9d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":629},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json new file mode 100644 index 0000000000..db3c7473ae --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8JO0vsudLsn3xQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oqMtz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SKDyAWVqoxpp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"1L7RStmKtSr3bQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"6Iw3iLR9g6gw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YupYsx0ZJ1aMa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5qdJEWKpo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"mGogWBpgESnTz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"v7EExHmtd1OajF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"miXIWYNorB5D0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"EQdBwNrcROpal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"zITST6BhaxT9Ugd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"bHKCX02JxyvuGza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"B668oUWAbdLuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ZJ8qq7AkJRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"z3wOmrqRlFgRZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"KspIWknwkVhrvxI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"iWfPSZFt1cqdCvH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nAz3Mtd6lPbIMgS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"CWYWQMvTUPa9e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"KxV4ME2ejqGEE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Zz1niin6bIon1UN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"hQ1i5HSIR452jL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"1kvKo6AUQl840r\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":590,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":617},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json new file mode 100644 index 0000000000..f64ab45c9d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3GeXnhZLrPbqxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AwGbpp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Ort6dnXhsiidn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Ot5bWSwy5TJX4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TVeOU026CgO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CZeckvhhvnFwZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"MFqdg1ttFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"H8AQdwUAfhwli\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"jIhxKQdcXFXp60\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZxM5W93K4J2vw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"h6FiOzKW7CsQ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sJejhRukl6L8aLT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NeO0oFDa4H11Jg5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Za6iqC5MDA0YN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"hC19GKbtHBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KAKlewK3vuDIw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"BweuJlN2QIQ9Sws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"okwpINAvAmHmS9w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"YOt1yW1TjV0CvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"4nWfFEt5cVc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"cCm8fI8Q0AHt0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"zPGo942ckImq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"h0ijzIrKNEgEam1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"YXTT5osSs03jgk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"NlGaTHwZ9MpdlY\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":592,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":620},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json deleted file mode 100644 index ac213e80a8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_a44f5f3213caeacb4097fa2f999d8dbc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OjTccOtpUFyRlA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"los6VP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"WcdRv72mBYf4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GBFiyMGpbRHVD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jvAKNWT8ub0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nmr8LXFBjAZsT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jxtUgPLLSV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"trI9dtqGIxYDL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"SjyOE9I9XqdkhQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JXxmua6nnkav3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"obpmgr2UUEL8C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"IqnH4WiqhDQ90TS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"33RPjbRjUqNpM4j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y142abTwJnnKn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"VTrzHxkn2D8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HzdVnkzODrH1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CqiAga8uRewB5FM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rVOO0qEo7lTmokZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"Ing1v60pshYypO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"VWPPC7j2tVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"8GoRuYMRZuXcH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"bJNYwCd6shEb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"cNxXd7OCyboVcAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XXQsraEzhUFNnj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4nVwSCstngPrKu\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdaffbc548194b0504fd8befb23be0a93035bd564e1cf\",\"object\":\"response\",\"created_at\":1757403903,\"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_68bfdb00aeb08194bb7bc53a92b201490a93035bd564e1cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":632},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json deleted file mode 100644 index a47721ab60..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_04b206e81d5fa5883392048171a9dbf0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZEK3CsaRTrB8PJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"apVGaM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cKkbwxY3FAAL3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"KHjkTUiTgJ5Uy5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1l8G7O6CPhFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6bkjQiG6os212\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ImSFx4zDPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KrdUPgop7j6Gf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"coBZUmkHWGsKUh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BHcjlkq1z77ls\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ETTtGWzlWySZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"MfkBPPo9paON8Lp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nkJyTtPVW9aUT1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"USd3ZDeNQICUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"vsO2sqBLDjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WNYBkMTUn8RNn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pFuGwygMNSJq7uT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"K9y4hmuBEcQ6YUQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"eDv5aTSCXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"O8fDMu67d4NmUD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Usd8uWju1yRJ4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"6J3BQsanikrh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"wqtPKXJ8eNq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"bPyYeg7YU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7SccePq0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"UynlMBk1ec8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"egnEJLcorx3cD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"E0Gv5huBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9ykRzk5ECyIiG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"y44M1c4YtHZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"6HehQzr9AOF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"45C49CXY8Lsys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"YGZYZlE0Onh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"HbCaIsvGDM7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"gs1X4F4IwTvVz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"pKVa0sUBGjmbgbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"hvHlC5efSFos\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Kow1ihWdEhht\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"MNLZaXKYR4zjszR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"bMaPL1CJnRd3gkh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"PQieB5dUuDrEdz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"44rVKKti5I2P5D\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68bfdaf81370819687e803f7c9fa580a00cb0e9fb4044843\",\"object\":\"response\",\"created_at\":1757403896,\"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_68bfdaf893cc819689dec78008f9bf9700cb0e9fb4044843\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":709,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json new file mode 100644 index 0000000000..0a71506e9d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nMYVWOypjZGnz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Xw8m55\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"oKNxAHUQMC7iY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XCcsOIcjMisHRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pzZdJi0bRJXZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7u3iQZNdcd00G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"42CEZAOU1R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ivkP41rORQvaM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"kHV7irh9qjiX0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kpmMYsW73hlit\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"UQHsrjkf99gHM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1uiBlLzHAj88uXD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"bcJmpNpCYlDGCpo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bQRIPWvl25xg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zO2bkw9GcnL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EndMmb1vN6OcF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"2ahYBRreIiSC27p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"w1eUYnFC0YQsK6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"UEEhukOhBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"LXAvUfqeIVKjPgJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"wg9W1okUvaoQ3s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"vlg2vYk6bmdV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"shFKQleO6jW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"bhEZFHTYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"AekywbnM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"dikIQKITuje\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KvT6QnxTpe30G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"J9V3CoLdE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"vNrD0tJsUXdmrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"PWvd6CJP3oG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"xgnbQq5qLb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bhSMYF8iYOO4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"btqVMZFxe1HF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"OgewcCCaqIgh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"CRi5dr4ubEfxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"Nsk8MMNvJh5zEKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"QyGNa7pM4TqF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"GWAqdEq78ZB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"qZtd2CvABuH0vno\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"T73ofShW8aukXkC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"q6qiHEzVbp486K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"MsIzM6Z2GitINK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":697,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":744},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json deleted file mode 100644 index 4f096e2731..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_0185e23dcac3614328581a4bdc8c5412.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tehFRtYIwLExaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"IzEpHM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gwlEnzBpEMjwe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"U0ejLbxOKsQat4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"FnNsizTrjosj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RbBOLOrCK9tEz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ShD7BfwLAY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lg8o2Dw5O6l5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"gk4aakFr6Wt0xG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jk8qTsGgrtoWn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Y3Akdv2iXigjH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"fvVKT5Gk03OdS6x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Ub1SwqDlNQJJE3x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LOADFSkqkq5U9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"56UTGNKS9Ox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pboGkqC5TeJoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"7pbnxpDpBj6wsrD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"MeVWABY0LAZUyZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"PicTWdzlEUHzjDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"390FjsRDwdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GS2rGCQoxpunIbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"OoTUv4HtsgR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"d9MFSDeOXqTiLF2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"udRljOZbljRxnS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2AfI1ztnIiaByS\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdae9057881979620bc1194d0663a014a9c1e20321497\",\"object\":\"response\",\"created_at\":1757403881,\"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_68bfdae979b081978a922a7b7075e13e014a9c1e20321497\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":728},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json new file mode 100644 index 0000000000..e5c9063f07 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HLt92VMu7Usmua\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"GSLfUe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"NtLlNHiijAKMA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"imwFQCZZWEkF5H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S5wbVCGyKyLM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tmG3RRQ13cRFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"sgCiUsV5y7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XblWlBhhUUM0g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"5vgbrPkGhAIH5F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"F1BgNyCubeJ70\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"cUi3zH3T7CZxB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"HvKujI8cyfSQYN4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"CfVBUpkJxfZrAfF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ut9nHYK55Ap7O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"GwNeoLjC5Vt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"27PcdsoIVLvTQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pHAND1CLYQPd2Xn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WykB7XQW0W6BoeA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tgpkVHBYcM7jDgg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"DOt4kIgCRDO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"PhiIb2SPedVkxj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"TzS8IZHwwa3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xCbpTLc8vCSBAhI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"SZthpkShqyqKCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nrCC4f3v8OsXyx\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":716},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json new file mode 100644 index 0000000000..511a6472e3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"PswrYIXTsdDrgl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"z6SoWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"oi2cCABRt4bEB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfhp03IhoUhy3r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0OVOAGt3djcr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"evXstxEFInsQu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Upk29P8EdU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Rvy3T1pxvQqQ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WLPOP7T5gJHFrW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SaLfBtNjHvplZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tqZW1wUANfJ5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"0uks9TZuprTbHBI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UlFfyerE1CakLLT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fTybXUMxOx46z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WciwVb639ow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1zIrgaU7j4Qt3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3N54jSXoAqdqZ8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WF6YD5h0PgVmOtV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"tDbtgbQkMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"tLHSLk6pS3nNVdA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"yJZfclpE7pjvrB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"1RxlrTMGzKld\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xdFru8qJRGC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"a9h2FhcyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"dYTAhGNE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Nj7IsZWtYCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OyhHIOiqAkKp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"jsdiRcrRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fI6jkeK1S9HW4L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"3K4dDv3ncow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"IjSTCTYaCjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"GwQCZ6TTxlDxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"qC9DVZA5l4Dk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"I9pYuQrE8apY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"QbEH6dxx55FYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"aKiqG0dwFtcH8rL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"vKIqpdHFxJix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"FLkkrhvMxhiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GGpdIJRrqYQvUu9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"cUWnXtShS5vfNWA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"piiv5lfVfVbs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"NqobslFgfRbj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"thrHL8RyJkAO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"yeiDod8PTB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"9xPkh08XOSWatC5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"uVDCqxh8EQNrcO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"OKLaXSHA3syl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"djbPshnsf0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"A6tJtf9Miqw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"Unw2rpfV4Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"7qq78BUZdS9Wx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"yBYK9mcFPHnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2nruwqhiLDbYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"ULFqoNpNkcZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"4uFeU8tYWii\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"hfSohGKwOuE4o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"Ppwu91tOJMK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GN3lWgM4KkCTNu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XI8quclAELXwye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"zls04QV66oVECw\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":70,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":71,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":72,\"output_index\":0,\"item\":{\"id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":73,\"response\":{\"id\":\"resp_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":690,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":67,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":757},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json deleted file mode 100644 index b55905f8eb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_7db10c7b76b46c21e20df5ec249c6f11.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"bC72iduBUfXyl9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"hLMkH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"pc9Mqmfe7T4NO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"A1uTs7WcegNxkx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S8kNNLvk619Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eRKiBvkJqamw0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"3M3DR39gUZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wuDLgl24OlR86\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PuLvvQkDGYeI7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oVuSQHZvf47om\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Bkln0muD3A8JB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"H7QeH9N0CZORp5A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RLimPR9wXZ2SPOs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IZzrQ7zGKnZXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"twIzpw4DALM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"g3fbVfnZnof5h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"KtmGN90BqDXpFhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gACe84u2NIO7Jqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"uqhwWAPjt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"utWTGmX5ZEcvMRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"qv5G9n1XqXwkrf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"THjNG0JCnwHt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lpGoplOKXr8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"Mzk22Gxi8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"kE34kIUG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"tJvOTBw3mox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eQo4ys40e9SGZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"rUTyxxHXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"V8Xf1VRVe9pRoB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lmhdJW0f5Og\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"lVcFizL4tcb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Zm7UoN6etwBB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"IHLmSXH7FXXC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ZgetsMvlsr1l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"iP3FqRv8JV981\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"5jWebhA3KGuORsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"YEgxUzZqHwAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"5QZo6z4dC17u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"ewMlFt6YZipQXqR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jlWQkDYMJqAUsHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"Ylv324Twv2xX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"5ex0Cdn5x2hG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"jW4qzDuUIwJF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"YgjohFVZBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"4S1yC1uLxN7ghnp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3MM6wD6NTJp34d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"kIFDbqaZp9hM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"uYsB5PgLMkN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"l54OZ1DOCJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"j36uLLvFEW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"p7ZXkNp24HbdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"A2WDlGXzSqpa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"bUt5DCA8sOGmW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"SCN44Uv9KcYe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"HezRkgnud7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"0PosLViKmg5Ft\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"xzY67LnjOW6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"g1UsSm0gzbEAc5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GGoj1lIta1faB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"CTnrUNTxwZP0CD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":70,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":71,\"item_id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":72,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":73,\"response\":{\"id\":\"resp_68bfdaeeb4e081959cfa82bdbb09623e0dde33f530b4ce87\",\"object\":\"response\",\"created_at\":1757403886,\"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_68bfdaef589c8195b87a32566787deba0dde33f530b4ce87\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":702,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":67,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json new file mode 100644 index 0000000000..1b98299fbc --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"e4J1nu7JY6VWH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ezurb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Nzid1jAObdAxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EbbEM6KYMeczx9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"sgrgkCyxoGLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"AxBIGNBvdYIPI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"n6XDTWh3on\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DgkhsUggXPBUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"YCAyqm5WPchU5k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mpeXEAjVUBswJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"UOE3JD0zobkAE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Wqk9oPLNz9DWttY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JJmb3d9L3cQnXUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1J4T4FmEY8JKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"rqMuTqLjwVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"T9xJdYjr6xvDz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"frczqurxvNZEDVd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bY5FiPrKDoHf4bd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"rLAQ1gmSM4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"TOgs9Gmkh89ZOoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"86tldXbMSYWAL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"yP126Me6hD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tUoX7iPo7iFpAAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"43YHLHVhjTxpy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"4dCtT5vYVdNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"OfVsiU6LaN1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"Q6OyFZvNd0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"Qc8brPhWKLn9y8n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"6VKAJwbzjOXHUO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"jJInKuBHYxrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"qcdJae3WciF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"LGrnkEAGw2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"gayOEMOQBs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zq1mo1bbb2PUX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"sYn1xBXgbg2A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"C7c8n3BgFITL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"pIISirmBm96J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"SgQx46WutKb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"taoUarnaCq5MN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"9sHvXFbm0mV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xHGyz4Y99tE4sWO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"heJttVbNg9KkBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RRffWl5ZDQZMv6\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":706,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json deleted file mode 100644 index 14238fb041..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_63050bff5088b8d04fbcd651e05ae882.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"JQfYqmVYEafmTl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"40qm6V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Py30gxAJvB99y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UREUJUsc2Yodne\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BpgFly6p6LFN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GK0KGLpVRqWKJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XmGdjNpCo4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oQbyJwuDPfp4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"51rmNlU7bYPWOp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CY7ehNK16YS5T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yjeDEkMeJNnc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"lqmHEWuagQNF5lo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NebenKwu8rvYsHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"R1AUwtXr4uTnf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QVMCPR6CNSp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7Gr4XzFVqxPsi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Xy5BG5IEercXAhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"cNEBPdMSRCNLOGT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HaYgcKLevW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"HXF8pEXLlopDokf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"9LAcy1wGTMDJaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"IsxWqX8GBd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"JzhBIPHUwmp5Svu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"j8WRfD90WrhCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"Ry1YTZaMl07a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"eBAPJWv0QaAd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"ZCfxDCMRRU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"fCQrnJpCQg379BS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"j1m8ISc7nqVsze\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KuiImjAWMVI1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"IoLf9VF46Ek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"BgeOJWDEWsm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"TOk9Hm90oa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X8V6pWbSQzNVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"BMcwyslzvWzH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"W6NT1uVbPRen6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"eOHTyc57XA2Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"QVRToaIgWkn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"NFklHNrd5FMJ8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"vxGLsY2aiC9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"zg4JYXs55Og8zTk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"pl1KUy8fDrPigl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nS53grITQMa2dr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68bfdaf0598c8197a1d3ee75ca66e0e10fbe8f2a334167d3\",\"object\":\"response\",\"created_at\":1757403888,\"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_68bfdaf104548197b963071e4a114e8f0fbe8f2a334167d3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":718,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":768},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json new file mode 100644 index 0000000000..f2fcd5d076 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I4aoQqmJr99z0k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"XhIHYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UTexR3OSg3ZbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XoiddNgCWrgJBC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bGeZ6u0RR7VO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MvLoaRy93qmqL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wqXyViL9va\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YnLUWDMzPLvEf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Qn6Uswxqvdgoes\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1T8MVsvT5EnNs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"g5YTmkhmkBDlt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"VUIcYUNpsOeMYJ5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"40NEbwYeNmHyWGs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ygQGCLdTMXszZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bZqBhX684NM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DMcVKTBKsiAhj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RWFJWJ0DyMoptBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Z3LFQz5MzKOzBna\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"MCMnGeqGqq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BUxieawawM94P1M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"kZSb0LJm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"r3iqkObp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"A0VWGfwsVOIrLtC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"pouAjR4f1ZsMSo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4xqIR6PQCtw8p3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":696,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":724},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json deleted file mode 100644 index 1727ea5ccc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3fc0e4e9437f5f16bf127ba6582a5a9a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XYUX3dtGlFRKk4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ylaO77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dmX1Dhof55oHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"o4FgfLlBGYpGhy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"hw7LZvfUe6ox\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5r2WGlYM95JF1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QWOrqJ2HcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YPJQpPclrI2bb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"vDrvO50bwhZ1xB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OM1DV0eydEL41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WLaSiHPdm52kA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"7UfxEwzm84138ff\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QlZXxemQ0Asheyj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TlTae0bpwlIDn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"dwbsrkmMCVa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jhwfaqod8IDiB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wHK4QH8gzYoA1mE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tIQVfcQuDTfQJZO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"NStGDZjDon\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"JHW8mBR7Xbqbvh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"8NZKm6uE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"9Z8A4Xur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"uJOihODqnIIm8s2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"08RZ4KYRvp9wH2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"r2C3AU0YZFfDrt\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68bfdaed202c8196bd5283d19ba5ea470ca6799c6f6fc239\",\"object\":\"response\",\"created_at\":1757403885,\"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_68bfdaedb9b48196b12e5adafd4513380ca6799c6f6fc239\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":708,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":736},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json deleted file mode 100644 index 272c689f9d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b2492cfb8ed8d2763405374a07be39ac.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Nf1LmAo6GxLRbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"vh6lZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"zTWzXmLfhL1sN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UWbuI1dwDFeCRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bYKC3nOG5DgI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WxddI2xQc3rlo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"spaOVUQ0QN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"b8QEW8yCdou7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Gth6qDRIyXzqO7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w5P428PITaz8I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"SKsvbKuvYMNwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tghfcRv5T9tWbQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"osfUtWOJPZnHMzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eoKqEtAfFBEUd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ZDwvcb2pcPT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"M3OEQMYwaS4v3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"nf988XIsZjCIhaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"VXFDaJPyeBXGN2k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"ObA0ha7wU8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"V602cr9vQjY3saf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"eZA2pX2ZJuU7pi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Bd3JUiiGgw7E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"wZCjnZBRE7K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"ueO50jeeP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"5XNRPc2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"2k9CFH8yVey\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"GhWC7eusr0lLB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"SpsQ6bhD4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2Bh8TYRdTPIwF0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UiNANRMKVwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"4BOIj1KChh3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9eSzURV8xHVXj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"VRnBktFHNEq7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ZOo9IQkWIr24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"RX0aGNvGt0ynq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"5uw5mjhMOfpNfUX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"2We4RQzlMXo5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"sOyHPvWjLi6a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"lATHY9K3NhGsl6K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"76ZxZxmuwWWHSO2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"hkBJbq60J56lui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"x7pMD3Dc0X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"a5D2SD0X9ZjYAUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"XRF45Ae1sN5q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"SEtpN6OwXvaW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"vn1ChAJpO9so\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"bCnGQgTpDf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"SuM7YzoprQWw3Hx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Fxqon62RoXAT24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"VAwhpvDHxcUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"vcgE4avcnI4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"ux6ERieuuJt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"42yxCI5jqk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bhURlRfvtsuTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"NwIS0f7LrbsH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"4E1bwEpFKFdfR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"jEAdLq5bTrQz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"ouKXNNilESV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"qBVoaw5Ev1Ze0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"iECyicQsD2x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"NbqGd0ENcbpsi4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"JqsSV83aood0rj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GqZJvxMXYKlXbj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":75,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":76,\"item_id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":77,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":78,\"response\":{\"id\":\"resp_68bfdaf95ce8819780a810fceb53c89a09e348432452e8fb\",\"object\":\"response\",\"created_at\":1757403897,\"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_68bfdaf9b1f48197a6df6b8989778db409e348432452e8fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":72,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":772},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json new file mode 100644 index 0000000000..baf2f93585 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"7oT7O2Cr2TYFuP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIaI76\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dHHSf8M6itUqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZWTyFClxUY3GGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"7WU3oKdm7YWo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ndwIPny9sEUzL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0m6INvatrn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WcQh1TkNtI0EG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"QKI97IXJMACuk0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"exQwMmerYjVN9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O661T4ZVVj2lZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"qrAMrHFGTEFbDjK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"7TT9JSu0QZr2B0E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lbEM1YPHqVozy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"tAhep5X0U2s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"AegYl7Ha6iDzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"s3RyN6utTI6iuW1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"7LU7PP196HlQGIx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"JI6KWJ6435\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9mJqUrc3RcryRj6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MJbG5UUuZ56ZRc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"FkQCXd02A8DH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"e6RMTkHl3he\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"xig9jvpkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"N3YtWbyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"aYzcZTk9v4G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KEBhW02ZXkDTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"tVQCatPD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VgsDEn2wM2pemG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NLYxRRWjI1L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"tfHyw4sF885\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"apyvNGSQhYwZf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"yVznJgrZjd9Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"0ou2vtak5jBC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"XBUBp2zCBLHd4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"NpluL9H0efc7ymw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"UAJOlwMXz4uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Os6kWs9Tqg4q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"MRe5sH3Z2sLUUse\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"v9C5ETD8OFxF6fj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"RhX9jPKNOLKxCd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"OGfew1l277\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"emsBXor4iEZMNd3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"uHuXQ81sF4QcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"xDXVPHCrzsJY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"phXVg4HDl2jH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"qAqJ7UH5AO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"bzPXZYdfku0aomN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"R5Rc5K6ooc16Ki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"E2qdyP2EPyPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"MCsJz9GClOX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"Wz47MA2A8mg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"VX2HJmGspR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ExYHLHZrp4cz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"JZPqx7j5TyRx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IIMKKt6DabICs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"gfyrNq1lPNJF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"OdOFslvzMMy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"WQW1lG9neoqnd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"9jlOAcIHD6Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KSOHyZ2NaKyzlRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"adlaPCCyiq3vuN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bkhX0hjh1CNsKw\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":75,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":76,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":77,\"output_index\":0,\"item\":{\"id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":78,\"response\":{\"id\":\"resp_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":72,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json new file mode 100644 index 0000000000..987ffdbb76 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"d0ymnY2BPGEsNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"U9AFAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HE6FzdXWesbrz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lWUwh0plpGykUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0Zk97Q7IHOc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Glcmc5x5j3SJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"1CNfBfoHwX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ROwtD9EPiovaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"xb9sM1Ih5wut5I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"az2rqPjTgcMlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"eccO840CzgO7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tjOcaxyfNJxqAdT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"azJ4gbbtDdyWJqk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ip1eXsdvax1Dt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"5Bygy3Tnv0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gBKr45bG2xFky\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"YmOCXaD08KiGywY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dyLZLNOwqFtcfDe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"FfoSWvKMbqFUGbF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"fLOa3YV1KTy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"g2yWn4LzFek9kx7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"FobrWTZ7xM3Yek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"EbMHbQgRANr3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"huZ2J01sWiN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"P3Yib1Wur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"gnBWl4MY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"KWGAQe4o93s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"EQh8v0eD6JQz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"kiMCbGwH5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Egt9Qbxn2sbj2W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"zXrNQzafEIl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"3ufGytoHOwI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"b1tj1tdewlU3L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"BmPr5UbdDspW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"RokVauZPbKbu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"RjAZWbGP4ZVu5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"tnULDjPl3VddJ8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"cd1DuV0byIE5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"9Fh0rziWl5QV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"wHoXn8vtcgiD2GG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"9FruVW4Ulk4PAd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"HyDZt9Tclmz2ju\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"avN7xKtDgN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"f8yiGD04S6VvoWG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"dSuS8xbOJ0atC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"wAhVNtmFkuj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"JXwLuUcIOPwoI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"1NWpvvyWMTzM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"5UFcxhAok0miTyN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"xk79LBH770sgLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"dSnpQNHrw4q0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"hmkpKDppS7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"CbEk5xv87K9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"G46JLW9BUR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wzTrOd1zjWXq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"IW4CDdcrOKlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"NyAtl5mxDBPbf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"sTsYDwFYzs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"N0CfOYYzmcg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"LgR4bZBoVxZk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"7IIyv3D3DNX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"kJXwFMfoEsxJpqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"08VGfcZHRCAU10\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"x8aoOkEmctBtoO\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":76,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":77,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":78,\"output_index\":0,\"item\":{\"id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":79,\"response\":{\"id\":\"resp_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":73,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json deleted file mode 100644 index da8fa225bb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_e53435bc11f15a90456f69fb7826125c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fYViooYJJ2Lcnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"RoWe9J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cdO0YDLe2hNZq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4rMtxGhBRTcxbR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gQOahYbo3hXt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iOKcwAWJlBv11\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"zdZ8WzKCvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ekbR86243QiFU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Rje6JfKC95kL4e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"18J6R9MTZUc13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ZjZIf59AVBY0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Buto3gskDZAFkfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"WsD8CruPGoV8lRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"MvqYF47pZ3Uz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"xqqwHacAXmS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eJIBVczthe3FG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ayPSm93v9bXjGTm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"l4EI1NJw9V14bM9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0sg70mLTrRJVl2G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"eWB3TK0nu2P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GmyVm72EzAZDepW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Pg3zlACbcVICwM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"5LRUT0L3EpBK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"d2BCGMOR4oQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"UDXxYRzj7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"5eCkbKpJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"qVFQWBSFDWM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"S8Fdxf1hsKVen\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"4rNDzqUXd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"8QWyxTQpx4WpxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lncyClL8zYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"6GkDY4SE2IF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"sMNTmhOLEkzXx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"Xoqu0Qw7bsiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"5H2QuZQi1UYl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2h8atWOpsg8cU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"Z2JtSmJZGDV6Rf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"P5tIlqdP93dS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"dG0z1FPrCzX4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"3ibEbzFV5pIc2Cy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"PpmzjyLWOxGe36H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"pRC0EpfyyHPlsy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"4dAxkFoBW9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"hONfAwGDLL5DbFk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"wMITaVSFeXnbC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"UUFFZU2eLr6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"nMhbdGkebd36l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"z23SBKmE4558\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"QDXp41JlkouGwov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"2MIYSd1ZhAkIn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"gJcc22BQkR8r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2ilFjwU2f60\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"gxEd7TO4wy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"5Ci8PXptDV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"h9g6hWFGJ3vXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"lIODgbpTN6il\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"Fgv1rRldCVYYQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"JE8wDNuzNR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"IC2GkPZCNaW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"M4ttVoAMZOqn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"lhJFZjOZRUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DamvzbBoOFGOpgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sApJEybsvEVowY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"0JPq9jFQS2iLGA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":76,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":77,\"item_id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":78,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":79,\"response\":{\"id\":\"resp_68bfdb10d7488196932c1da54bfc787c09c807487f5234f1\",\"object\":\"response\",\"created_at\":1757403920,\"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_68bfdb117a688196a111a03b3a60e9f609c807487f5234f1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":710,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":73,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":783},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json deleted file mode 100644 index 82a07871be..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_1c6f556ad52f3df41659515bfc1b1aa7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"g2JgsZKekr4s10\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"rC8rYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"X9baoJWPA7cIl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"xjAzjPUYXuIwkT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"u9EacTCxXvas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x4EUk8ZNCGozo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"d2RmZ06ofO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"s9uSzbpvSn7aN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"G6VL9pLor8JqJT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"08fxqvCPqV8LH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FU5TieXdkDZwI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"B1DlXmuf8rL9l4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mwrs3VUH6apmbCp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uwSn1jO8WbFjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"h1vciKmTPck\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"btRoKvuqu3jTn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"WtdopWfoFl4tvU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ZKWhSEw5lF0foHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"28E916zVRLreFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"mKNYwiG6xS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"wkQyh21pjp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"EIwfBgCul1TRuIO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"2A3G67oHZX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"nnf2zq7JhO5tj5X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"V1AF2BRdmVM2Qm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"hQRTq9SxH3hm4N\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68bfdaf70f048197bc12c26ede6cac5e03d2ea43d6dad7d8\",\"object\":\"response\",\"created_at\":1757403895,\"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_68bfdaf76a988197b192a770cea8a8db03d2ea43d6dad7d8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":729},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json new file mode 100644 index 0000000000..82afb81e1d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rFPnVuhXKFK05e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"789fOg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"vI61UB7SzbAIW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AOMVKKDvz4hWOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"d50FQfnDI72c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HO7Wh3VeiShWq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BFwQEBuHfC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Tgy2ShwPwmmA1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qYz94hr9hZQkdx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x4Fkt8h7C8343\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wN6RTr4eqMV0r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Q7jECy7OkJaYyZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"d3Lmk1yRqcnUZKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LAH8jSWlclHT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"hRds0fkgJUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7mc7SFbKgsJdN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"lji8ldtE5Xw8O39\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"7weKfn7104o95p9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"smIIkzOfxi3fRV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"oouoOC2cBb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"DLsza95zTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"l2GDKMnGjre8UAF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"Y9klNFJWlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VPcBBHhqUjSRJU0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Row3JW6Cq4kcSM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WT5WN1vYCvxX0L\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":686,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json deleted file mode 100644 index de95f8223d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_209aa14d6a0de75ac1558f50749be796.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qNcAMG9AH71o88\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"KStEqN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"qBqoIHHdvuY6l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"9y9CXAkt9uxzMF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"G7F2HTuLuBzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KnM3tJ9n3xNob\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6LcfuxgkOk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oL0NG7B1IQ3mB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"naW0Tw9XPG2hkN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4437Lph2WGLAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iVZGITx3xXvPd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WeKcslJ5lIwcRaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"vQ3B3pr9gGKUOcP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"j3rSeoQT41elN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"z2u8zaADyU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ug7xAO223ngFl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pcOWZdBIxSqnIho\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"DKe2g29TIDenDHf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"Mf7dvqu7i1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BFleasfBYdvFpbH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"pdbSD2QJSOLCOA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"ukQ3y6eOjF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sbtrl83AGV60VXK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"62j86QolA12\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"OX04Auaou4hJhcH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"TAvrkJ3tWIGqqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RO9S0S8QeVbxin\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68bfdaf55cd88195b9b6a691a87284df0d5554d4135bbb33\",\"object\":\"response\",\"created_at\":1757403893,\"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_68bfdaf65edc819595d5dc99dfd718ff0d5554d4135bbb33\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":705,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":737},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json new file mode 100644 index 0000000000..13d2db5948 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Fb3Nlt59YpcdYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JZnNB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"BV0C4PEhStuqA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LaPVlUhsUbVtWr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"cP4zlO3EvNlQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"K5DFQxIYiIBq2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QdmFQ8TPoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sedAvL7jFoVVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"niFBeNiZvUXvba\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tSt5TtGZmnQWq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"6vewRzS6fTMA6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"hPA1xBXPMdNvEIL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rpyDeTw8WdIAomQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bN2hHukxBiXKO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BYLIDoG5qOE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OaC5ekzzVUr6y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"u25fe9tDGljatlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xFihGu4anvpBsPO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HLGahjmiz7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"C6T7LShYrkZIfCC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"nEjothEOia1dtf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"9QvJcod3kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"CixxJocEb4PTsBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"mKISvoMrofu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"iP5UKa0wzuozxEZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"NenwtSMVUlPbMn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OK0iGBXLfwan2q\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":693,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":725},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json deleted file mode 100644 index 693fe9184e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_a59a9b5891c5d484937aae60bb84ea07.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3y85POk9DLDpxC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yH3pxK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dvf1SKokObrhi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k6xxbfauY1J6Nt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1BvZlvKU1njn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x9rEMrvfBHRDw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"t8w4qAXngt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HJjvjjyVPZ56L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Nhmm1fVMCm3Rlt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N8req3PaaTyGT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"vtZFuo67eDvGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"4Rc35BTpqvdWpG1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"XkE6SX9iPr34gC9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NrUXAjLxq1bS2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qeUxgwg4kSj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7PocCXoF6SUod\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QfyWXLBlxgHLrfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"AKEZ7MJs6dg9ppq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tF2zV8SCxVkQgBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Vr5No9n2tzU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"vHKbrTJMtpYi1ev\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"qu5716gMSGKlAk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"lq5v0pqAX7t8eN\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68bfdb0a3280819490bd1594d4b37da7035a10a976dead09\",\"object\":\"response\",\"created_at\":1757403914,\"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_68bfdb0aa6dc8194be4ce25fbf63ad3d035a10a976dead09\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":540,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":566},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json new file mode 100644 index 0000000000..8e659a3005 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3zA6dxvisfR5vX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"U4d4uH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"9zERYEYYfywbD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZXv9gEBslLI1Tc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"9uVFvHMLBU2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SS17gLAnVOaNl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ZqfTFrcCHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Bp1V571L6xzAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"nIePBmc38stMi7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CaKes6cgyJmTl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"hAdQG0e5sk6tk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"jRBVn1T4OT3GVsb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"dsy4bFhg1HRIBBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8fi2oxEl9NqTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"azIGbaYZoJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S1BUy3eRs6aB2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"oSS5jZTeh13M94J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"p8Egf38VsdX3Vme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"L3nK5meFrxlrVlO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"96ZVRTVUtZ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"QgAKqGIErsHtf4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"KeYgjbokgktlKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"52NuO7krlaNfRj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":526,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":552},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json deleted file mode 100644 index b91e5614ed..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_3caac015b33d4eeda58bd0af3a6a03da.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k1gWvt1xFTzztl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"PojpDn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"2ZG4pAqjBQene\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"V55QkjQ37cp6su\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AngGfrel0xjU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8l5pMAnlC9J9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bp46x6pXV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YpYaPmT1xCSof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0dj0ipNC6MFftC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fAcZ5WB0VuDLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"5vbNLzImcqoYg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2sOuP9YT2rAXB4a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nachvCERkyfOoTR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LlikkynLk8Qcq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"G32Xxe9LY3r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XwDb0pUPhoOYI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AVvjEd7RkFAg4dG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"3t5CwtXHpV6vTt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"JoBWYW4WhxVMIy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"HpgHDLhkuKz6iW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sIXOd5RRxRu2oOu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"aDqEJWHRBN4HI1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"Sc8pMlW1PQwm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"DTXwBirQRDyQOC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"Armq7SnRYMum\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gOCoyYF3C2yI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uOjqDbusfdYkk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RiHkdu0sMS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xk6Fb8nE09HZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"A6ZbWFvEspb1Rq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DmWPI5BqvrA2C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"M7W1gTJv4Q2Yh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"56EfJ4ia2ra87Ib\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"BauJnPzptTG85xf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AonTXrj9hzAa9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"UnAvvGSd8L9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YkSrujgKj7E65\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"dI6CtocsDyCBlkZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"IEr6qsemVYKNAV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"4v8iTQ6walTePg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"qjeawGFigMmnBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"TGnWZcoNh1JVShn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"KWnfWIJKJUWng\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"mFgbS34ZGwHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"tfQxcgnWzC5RQ5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2W0v5SU0Kg3xr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"mczW6GsJ9IWIwv\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68bfdafd5ff88194a2a8c2dea54c5aa50c5905fe9f141b90\",\"object\":\"response\",\"created_at\":1757403901,\"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_68bfdafdafb88194a8ef45e29058d9190c5905fe9f141b90\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":486,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":542},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json new file mode 100644 index 0000000000..6b4466f45a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lRxUHSPRd0euMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"X7XenZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"n9dO3cOn4nzh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"mORaFLm5K6MX46\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AQUNcNkhNX1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hakFRCFl7QIeQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"G9KiqmgiGN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WLndUqM2nlXDS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Hs6tV09sG9I5S4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rX3DZnThnfZpb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"D9qXvswzIhLTo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"6RfNuVp4bmVA5jo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"W1DjSLtXrjX53Gp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9WxSmKn8gYUji\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Wj6LOhzwZOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6M02I8xBrGMJV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AxiGAKPm6m2famZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"2c20XZtJShneug\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"H0ZINxvc4JVb17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"zxWPZeK19ElTPV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"6qDaOyQljiLoy24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"ETJETZrft0O0uy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"kurUORl81sgd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"DMh5Ndah2nixdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"1362QOVD4u25\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DuxEHGRD0rGD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BrmHVSSUSNIbQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"yFn6gOTejI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IPpMGRPGZ9Jov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"nTfRblxAkKssaY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KayI0HkMyAZ4F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JGLElAj7GrP7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YnPiJuQKE9rAUgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"07mJZa896okXhu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Y7vMzevlyMMtg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"deugxPGuTPf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"L5VqP4QqbcLG1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"14TQeVAC41YtxQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"whEclgyUSPsmjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"towqirdkfI0M4Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"8UMIQFHZtZSYDV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kq6rJhxTKSzMt1j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"R8dJPzg1quUru\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"3Lpk9egq0itf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"OYdcoAfGrNi85FZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Xqai2rHOQDn2mr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"c5R9vBJcbGrtzB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":472,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":528},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json deleted file mode 100644 index e4475152f9..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_374c98f6cf65c81138b95a534caa4be6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hjsebMQYdGYlmJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zDMedC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gV2dTjlXymruu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FroXSWGJEa8Z8F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"VfvyEHdGvipa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oQ1jGbSrRZ3Cy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ZEGpiwln3G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7mhKYCZdb0ltg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UGwE2x3J0uwmSh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rRyzdBakKAZxg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JCVfjS1bdvCDw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"y16jmuxzUxIcNQF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MwJmBhWMBnrDNGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"H2qjgohy2gOMb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WiGswy7PSuf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DzvFylCXEiWVq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UhFxTF0TCZyb0i1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"m0uJO41rb917pp3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"VWnp8FFgdbOUy2V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"p8tHrYO3FXjTIne\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"y8aP6PslCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"sBPd65hbgL2E4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"DcUmp9jHI8mPCkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"4MDsfcFwzr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"iZYK7s9hJNv5ylb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"h98qblr0Lxf4eC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"zEGCPaAGmXDeJZ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68bfdaebbdf48195b3b844f002846f510883fa87839c2223\",\"object\":\"response\",\"created_at\":1757403883,\"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_68bfdaec59b48195a905da06564e980b0883fa87839c2223\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":711,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":742},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json new file mode 100644 index 0000000000..30fe35e3a2 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"r3YWpAd8qnLzh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"MsrVf3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"k2mxbbF83qiLC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4xFBACUSfeBhhA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"95ALGwe423Fx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HNI2KWeOCbRCF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"3TeiqonSJ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SL77owBfBAVkr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"d3etjc3JM5Fsa4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BFakFdVGTTi8H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qlwsXN9XhSlUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gfZjz4Z69S1mMoz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"sfS61VEaQnFgoY2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8NnNdvJBDluEt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Ogm81LfZzUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ygXUKdXgCVcpu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"XARq8NR8OPHnTlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"fQvkjvsDJ3VM6yX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"U4y2N7oxZXSQOCS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"QK6py3kmZTePvxy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"GrS2TMxvEm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"w5dLzYygLwilB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"85a3hu0LID3frOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"uPMEYb7Rv6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0cQG1YrECFRjDAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"b68WzZ7Mhwatzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"i4PWFj1vj5tKad\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":699,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":730},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json new file mode 100644 index 0000000000..fc23f381ed --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"S7JFcbF56Hk7yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y1eQmc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0pmp9guGBMrhE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"d44XV0EQ1TWiID\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0tmmMs5i5Hda\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WvnioKtTFLtRJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"C9EWPrLhVd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PIqgavYqmQUYT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"e1g7f6NFucruOH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nWQxhM2zNGCKH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kyp4kXjOTZp2l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"zhm6T96u9YgBO9X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"42fDvtfW1a4TB9R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hsQNrGH1o0HHx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"JfdZMkuRDYx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"X6TVT3YplrfqH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"tyOTgvZ9N8NMsbW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"tuCTgRxT5U0YITT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"nuUKS2e3wBzinHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"SZf5v02uwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"AEYrRXqgUqdOZjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"2UPqZdy8Lz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0OXboHnRXmwZL3Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"QlJcXrcnQBzn6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"UqIfuJ73MRUSk3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json deleted file mode 100644 index f49688cb05..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9197856e6f82ebff9a1846cbfc765a7b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"u2KbmPIjqKgepc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8k5Qav\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"NeH5CrdwS28lj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"x7Q2i1XNgUt8OU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mwqjNXuA6VVC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vAjES0piqlMCI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4NPYuZ1gN1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Kl55oQS4hXIkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"m0iS32Hmq8jDWp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DUOzvWmtLgtMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Q3B2N5MgxKi9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"7QAdpXOsCeWaukl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"0RceZhVmVJbFQ5H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LUhAhoAzsGlO3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WO3gSzvBQZM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dLQSoWYk4OLET\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SZCDx0XsBZYpE5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"aJk33x4BI3NmfQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"74vo3sxjWzLQuvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HvmbheNFdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"u7bDPVWbrokBweO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"HH36k2iP0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Q1AE7b3CxbLA5iP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"OpccsuZEmzrWRb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"epoN5jo0GLC3Hr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68bfdaea9a38819091da5be265f58c940521f1fa6da0e0af\",\"object\":\"response\",\"created_at\":1757403882,\"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_68bfdaeb03748190a2b9cd07fa8db1060521f1fa6da0e0af\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":700,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":729},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 9d5fae4045..431381b4a7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -3,9 +3,9 @@ import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; import { afterAll, afterEach, beforeAll, describe } from "vitest"; -import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; +import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { htmlBlockLLMFormat } from "./htmlBlocks.js"; @@ -123,18 +123,31 @@ describe("Models", () => { params.stream ? "streaming" : "non-streaming" })`, () => { generateSharedTestCases( - (editor, options) => - doLLMRequest(editor, { - ...options, - dataFormat: htmlBlockLLMFormat, + { + streamToolsProvider: htmlBlockLLMFormat.getStreamToolsProvider({ withDelays: false, - - transport: new ClientSideTransport({ - model: params.model, + }), + transport: new ClientSideTransport({ + model: params.model, + stream: params.stream, + objectGeneration: true, + _additionalOptions: { maxRetries: 0, - stream: params.stream, - }), + }, }), + }, + // (editor, options) => + // doLLMRequest(editor, { + // ...options, + // dataFormat: htmlBlockLLMFormat, + // withDelays: false, + + // transport: new ClientSideTransport({ + // model: params.model, + // maxRetries: 0, + // stream: params.stream, + // }), + // }), // TODO: remove when matthew's parsing PR is merged { textAlignment: true, diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index bb4ecd1280..aeacd5ce72 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -87,7 +87,7 @@ export const htmlBlockLLMFormat = { ) => { return getStreamTools( editor, - opts.withDelays || true, + opts.withDelays ?? true, opts.defaultStreamTools, selectionInfo, onBlockUpdate, diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts index a2026ff442..21f2d529a0 100644 --- a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts +++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts @@ -1,3 +1,4 @@ +import { Chat, UIMessage } from "@ai-sdk/react"; import { BlockNoteEditor } from "@blocknote/core"; import { getCurrentTest, TaskContext } from "@vitest/runner"; import path from "path"; @@ -13,7 +14,8 @@ import { } from "../../../testUtil/cases/index.js"; import { updateOperationTestCases } from "../../../testUtil/cases/updateOperationTestCases.js"; import { validateRejectingResultsInOriginalDoc } from "../../../testUtil/suggestChangesTestUtil.js"; -import { LLMResponse } from "../../LLMResponse.js"; +import { LLMRequestHelpers } from "../../../types.js"; +import { doLLMRequest } from "../../LLMRequest.js"; const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__"); @@ -32,10 +34,7 @@ async function matchFileSnapshot(data: any, postFix = "") { } export function generateSharedTestCases( - callLLM: ( - editor: BlockNoteEditor, - params: { userPrompt: string; useSelection?: boolean }, - ) => Promise, + aiOptions: LLMRequestHelpers, skipTestsRequiringCapabilities?: { mentions?: boolean; textAlignment?: boolean; @@ -75,13 +74,24 @@ export function generateSharedTestCases( const originalDoc = editor.prosemirrorState.doc; - const result = await callLLM(editor, { + const chat = new Chat({ + sendAutomaticallyWhen: () => false, + transport: aiOptions.transport, + }); + + await doLLMRequest(editor, chat, { userPrompt: test.userPrompt, useSelection: selection !== undefined, + ...aiOptions, }); + // const result = await callLLM(editor, { + // userPrompt: test.userPrompt, + // useSelection: selection !== undefined, + // }); + // await result._logToolCalls(); - await result.execute(); + // await result.execute(); // the prosemirrorState has all details with suggested changes // This can be used for snapshots, but currently we've disabled this as there can @@ -89,7 +99,7 @@ export function generateSharedTestCases( // granularity of the suggested changes. Can be enabled for debugging: // await matchFileSnapshot(editor.prosemirrorState.doc.toJSON()); - + console.log(JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2)); validateRejectingResultsInOriginalDoc(editor, originalDoc); // we first need to accept changes to get the correct result diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index ff9177d2ce..444fdf8130 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -109,7 +109,7 @@ export class ClientSideTransport ...((_additionalOptions ?? {}) as any), }); - return objectAsToolCallInUIMessageStream(ret.object, "add"); // TODO + return objectAsToolCallInUIMessageStream(ret.object, "operations"); // TODO, better not hardcode } /** @@ -163,7 +163,7 @@ export class ClientSideTransport // Transform the partial object stream to a data stream format return partialObjectStreamAsToolCallInUIMessageStream( ret.fullStream, - "add", // TODO + "operations", // TODO, better not hardcode ); } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 5bddbff855..104b560bc0 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -112,7 +112,7 @@ function processToolCallPart(part: any, toolCallData: ToolCallStreamData) { export async function setupToolCallStreaming( streamTools: StreamTool[], chat: Chat, - onStart: () => void, + onStart?: () => void, ) { const toolCallStreams = new Map(); @@ -129,7 +129,7 @@ export async function setupToolCallStreaming( toolCallStreams.set(data.toolCallId, toolCallStreamData); if (first) { first = false; - onStart(); + onStart?.(); } } return toolCallStreams.get(data.toolCallId)!; From 0e35f39ba75b34e563537d4074789a23a8f45c7c Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 19:24:10 +0200 Subject: [PATCH 31/68] fix tests --- .../09-ai/05-manual-execution/src/App.tsx | 6 +- packages/xl-ai/src/api/LLMRequest.ts | 7 +- .../html-blocks/defaultHTMLPromptBuilder.ts | 24 +- .../formats/html-blocks/htmlBlocks.test.ts | 12 - .../src/api/formats/html-blocks/htmlBlocks.ts | 6 +- .../api/formats/html-blocks/htmlPromptData.ts | 6 +- .../formats/json/defaultJSONPromptBuilder.ts | 312 ++++++----------- .../api/formats/json/errorHandling.test.ts | 27 +- .../xl-ai/src/api/formats/json/json.test.ts | 33 +- packages/xl-ai/src/api/formats/json/json.ts | 92 +++-- .../src/api/formats/json/jsonPromptData.ts | 37 ++ .../api/formats/json/tools/jsontools.test.ts | 18 +- .../defaultMarkdownPromptBuilder.ts | 324 ++++++------------ .../markdown-blocks/markdownBlocks.test.ts | 39 +-- .../formats/markdown-blocks/markdownBlocks.ts | 92 +++-- .../markdown-blocks/markdownPromptData.ts | 41 ++- packages/xl-ai/src/api/index.ts | 8 +- .../AIMenu/getDefaultAIMenuItems.tsx | 73 ++-- packages/xl-ai/src/streamTool/asTool.ts | 40 +-- .../clientside/ClientSideTransport.ts | 2 +- .../vercelAiSdk/util/chatHandlers.ts | 13 +- .../util/partialObjectStreamUtil.ts | 8 +- .../testUtil/cases/editors/blockFormatting.ts | 6 +- .../src/testUtil/cases/editors/emptyEditor.ts | 6 +- .../cases/editors/formattingAndMentions.ts | 6 +- .../testUtil/cases/editors/simpleEditor.ts | 12 +- .../src/testUtil/cases/editors/tables.ts | 6 +- .../cases/updateOperationTestCases.ts | 18 +- 28 files changed, 555 insertions(+), 719 deletions(-) diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx index fb72b587cf..ed9b485346 100644 --- a/examples/09-ai/05-manual-execution/src/App.tsx +++ b/examples/09-ai/05-manual-execution/src/App.tsx @@ -20,11 +20,7 @@ export default function App() { ai: aiEn, // add default translations for the AI extension }, // Register the AI extension - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], // We set some initial content for demo purposes initialContent: [ { diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts index 5a6502d532..345881a840 100644 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ b/packages/xl-ai/src/api/LLMRequest.ts @@ -4,10 +4,9 @@ import { UIMessage } from "ai"; import { setupToolCallStreaming } from "../streamTool/vercelAiSdk/util/chatHandlers.js"; import { LLMRequestOptions } from "../types.js"; import { isEmptyParagraph } from "../util/emptyBlock.js"; -import { defaultHTMLPromptBuilder } from "./formats/html-blocks/defaultHTMLPromptBuilder.js"; import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; -import { defaultHTMLPromptDataBuilder } from "./formats/html-blocks/htmlPromptData.js"; import { promptAIRequestSender } from "./formats/promptAIRequestSender.js"; +import { llmFormats } from "./index.js"; import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; // TODO: figure out naming of this vs. aiRequest etc @@ -41,8 +40,8 @@ export async function doLLMRequest( if (!aiRequestSender) { aiRequestSender = promptAIRequestSender( - promptBuilder ?? defaultHTMLPromptBuilder, - defaultHTMLPromptDataBuilder, + promptBuilder ?? llmFormats.html.defaultPromptBuilder, + llmFormats.html.defaultPromptInputDataBuilder, ); } diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index ce7f3bbd79..c04964ae87 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -10,7 +10,7 @@ function promptManipulateSelectionHTMLBlocks( messages.push( { role: "assistant", - id: "html-selected-blocks-json-" + messages.length, + id: "document-state-" + messages.length, parts: [ { type: "text", @@ -32,7 +32,7 @@ function promptManipulateSelectionHTMLBlocks( }, { role: "user", - id: "html-user-prompt-" + messages.length, + id: "user-prompt-" + messages.length, parts: [ { type: "text", @@ -50,7 +50,7 @@ function promptManipulateSelectionHTMLBlocks( messages.push( { role: "system", - id: "html-selected-blocks", + id: "document-state-intro", parts: [ { type: "text", @@ -63,7 +63,7 @@ function promptManipulateSelectionHTMLBlocks( }, { role: "system", - id: "html-selected-blocks-json", + id: "document-state-selection", parts: [ { type: "text", @@ -73,7 +73,7 @@ function promptManipulateSelectionHTMLBlocks( }, { role: "system", - id: "html-document", + id: "document-state-context", parts: [ { type: "text", @@ -87,7 +87,7 @@ function promptManipulateSelectionHTMLBlocks( }, { role: "user", - id: "html-user-prompt", + id: "user-prompt", parts: [ { type: "text", @@ -106,7 +106,7 @@ function promptManipulateDocumentUseHTMLBlocks( messages.push( { role: "assistant", - id: "html-document-json-" + messages.length, + id: "document-state-" + messages.length, parts: [ { type: "text", @@ -120,7 +120,7 @@ function promptManipulateDocumentUseHTMLBlocks( }, { role: "user", - id: "html-user-prompt-" + messages.length, + id: "user-prompt-" + messages.length, parts: [ { type: "text", @@ -134,7 +134,7 @@ function promptManipulateDocumentUseHTMLBlocks( messages.push( { role: "system", - id: "html-document", + id: "document-state-intro", parts: [ { type: "text", @@ -148,7 +148,7 @@ function promptManipulateDocumentUseHTMLBlocks( }, { role: "system", - id: "html-document-json", + id: "document-state-data", parts: [ { type: "text", @@ -158,7 +158,7 @@ function promptManipulateDocumentUseHTMLBlocks( }, { role: "system", - id: "html-user-prompt", + id: "extended-instructions", parts: [ { type: "text", @@ -177,7 +177,7 @@ function promptManipulateDocumentUseHTMLBlocks( }, { role: "user", - id: "html-user-prompt", + id: "user-prompt", parts: [ { type: "text", diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 431381b4a7..a13bfedad4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -136,18 +136,6 @@ describe("Models", () => { }, }), }, - // (editor, options) => - // doLLMRequest(editor, { - // ...options, - // dataFormat: htmlBlockLLMFormat, - // withDelays: false, - - // transport: new ClientSideTransport({ - // model: params.model, - // maxRetries: 0, - // stream: params.stream, - // }), - // }), // TODO: remove when matthew's parsing PR is merged { textAlignment: true, diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index aeacd5ce72..dd095f86dc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -3,6 +3,7 @@ import { StreamTool } from "../../../streamTool/streamTool.js"; import { defaultHTMLPromptBuilder } from "./defaultHTMLPromptBuilder.js"; import { + defaultHTMLPromptInputDataBuilder, getDataForPromptNoSelection, getDataForPromptWithSelection, } from "./htmlPromptData.js"; @@ -101,7 +102,10 @@ export const htmlBlockLLMFormat = { */ defaultPromptBuilder: defaultHTMLPromptBuilder, - defaultPromptInputDataBuilder: getDataForPromptNoSelection, + /** + * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder + */ + defaultPromptInputDataBuilder: defaultHTMLPromptInputDataBuilder, /** * Helper functions which can be used when implementing a custom PromptBuilder diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts index 78fc67b109..cb5d32036d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts @@ -1,10 +1,10 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; +import { BlockNoteUserPrompt } from "../../../types.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; import { suffixIDs } from "../../promptHelpers/suffixIds.js"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; -import { BlockNoteUserPrompt } from "../PromptBuilder.js"; export type HTMLPromptData = ( | Awaited> @@ -13,10 +13,10 @@ export type HTMLPromptData = ( userPrompt: string; }; -export async function defaultHTMLPromptDataBuilder( +export async function defaultHTMLPromptInputDataBuilder( editor: BlockNoteEditor, blockNoteUserPrompt: BlockNoteUserPrompt, -) { +): Promise { if (blockNoteUserPrompt.selectedBlocks) { return { ...(await getDataForPromptWithSelection(editor, { diff --git a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts index b0adaecca1..e5b049cdec 100644 --- a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts @@ -1,44 +1,67 @@ import { UIMessage } from "ai"; -import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import type { PromptBuilder } from "../PromptBuilder.js"; -import { - getDataForPromptNoSelection, - getDataForPromptWithSelection, -} from "./jsonPromptData.js"; +import { JSONPromptData } from "./jsonPromptData.js"; -function promptManipulateSelectionJSONBlocks(opts: { - userPrompt: string; - jsonSelectedBlocks: any[]; - jsonDocument: any[]; - isEmptyDocument: boolean; -}): Array { - return [ +function promptManipulateSelectionJSONBlocks( + messages: UIMessage[], + opts: Exclude, +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "document-state-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):`, + }, + { + type: "text", + text: JSON.stringify(opts.jsonSelectedBlocks), + }, + { + type: "text", + text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.jsonDocument), + }, + ], + }, + { + role: "user", + id: "user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + } + + messages.push( { role: "system", - id: "json-selected-blocks", + id: "document-state-intro", parts: [ { type: "text", - text: `You're manipulating a selected part of a text document using HTML blocks. - Make sure to follow the json schema provided and always include the trailing $ in ids. + text: `You're manipulating a selected part of a text document using JSON blocks. + Make sure to follow the json schema provided and always include the trailing $ in ids. This is the selection as an array of JSON blocks:`, }, - ], - }, - { - role: "system", - id: "json-selected-blocks-json", - parts: [ { type: "text", text: JSON.stringify(opts.jsonSelectedBlocks), }, - ], - }, - { - role: "system", - id: "json-document", - parts: [ { type: "text", text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", @@ -49,19 +72,9 @@ function promptManipulateSelectionJSONBlocks(opts: { }, ], }, - { - role: "system", - id: "json-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", - id: "json-user-prompt", + id: "user-prompt", parts: [ { type: "text", @@ -69,46 +82,57 @@ function promptManipulateSelectionJSONBlocks(opts: { }, ], }, - ]; + ); } -function promptManipulateDocumentUseJSONBlocks(opts: { - userPrompt: string; - jsonBlocks: Array< - | any - | { - cursor: true; - } - >; - isEmptyDocument: boolean; -}): Array { - return [ +function promptManipulateDocumentUseJSONBlocks( + messages: UIMessage[], + opts: Exclude, +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "document-state-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`, + }, + { + type: "text", + text: JSON.stringify(opts.jsonBlocks), + }, + ], + }, + { + role: "user", + id: "user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + return; + } + messages.push( { role: "system", - id: "json-document", + id: "document-state", parts: [ { type: "text", text: `You're manipulating a text document using JSON blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). - This is the document as an array of JSON blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + This is the initial document as an array of JSON blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, }, - ], - }, - { - role: "system", - id: "json-document-json", - parts: [ { type: "text", text: JSON.stringify(opts.jsonBlocks), }, - ], - }, - { - role: "system", - id: "json-user-prompt", - parts: [ { type: "text", text: @@ -124,19 +148,9 @@ function promptManipulateDocumentUseJSONBlocks(opts: { }, ], }, - { - role: "system", - id: "json-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", - id: "json-user-prompt", + id: "user-prompt", parts: [ { type: "text", @@ -144,148 +158,16 @@ function promptManipulateDocumentUseJSONBlocks(opts: { }, ], }, - ]; + ); } -export const defaultJSONPromptBuilder: PromptBuilder = async (editor, opts) => { - const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; - - if (opts.selectedBlocks) { - const data = await getDataForPromptWithSelection(editor, { - selectedBlocks: opts.selectedBlocks, - }); - - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "json-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated selection. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "json-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.jsonSelectedBlocks), - }, - ], - }, - { - role: "system", - id: "json-previous-response-document", - parts: [ - { - type: "text", - text: "This is the updated entire document:", - }, - ], - }, - { - role: "system", - id: "json-previous-response-document-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.jsonDocument), - }, - ], - }, - { - role: "system", - id: "json-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "json-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateSelectionJSONBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); +export const defaultJSONPromptBuilder: PromptBuilder = async ( + messages, + inputData, +) => { + if (inputData.selection) { + promptManipulateSelectionJSONBlocks(messages, inputData); } else { - const data = await getDataForPromptNoSelection(editor, opts); - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "json-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated document. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "json-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.jsonBlocks), - }, - ], - }, - { - role: "system", - id: "json-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "json-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateDocumentUseJSONBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); + promptManipulateDocumentUseJSONBlocks(messages, inputData); } }; diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index 95a1326959..cbffab03a1 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -5,10 +5,11 @@ import { BlockNoteEditor } from "@blocknote/core"; import { HttpResponse, http } from "msw"; import { setupServer } from "msw/node"; import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; + +import { Chat } from "@ai-sdk/react"; +import { UIMessage } from "ai"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; -import { doLLMRequest } from "../../../types.js"; -import { jsonLLMFormat } from "./json.js"; +import { doLLMRequest } from "../../LLMRequest.js"; // Create client and models outside of test suites so they can be shared const client = createBlockNoteAIClient({ @@ -74,18 +75,20 @@ describe("Error handling", () => { let caughtError: any = null; try { - const result = await doLLMRequest(editor, { - userPrompt: "translate to Spanish", - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model: openai, + const chat = new Chat({ + sendAutomaticallyWhen: () => false, + transport: new ClientSideTransport({ + model: openai, + stream, + _additionalOptions: { maxRetries: 0, - stream, - }), + }, + objectGeneration: true, // TODO: switch to text }), - dataFormat: jsonLLMFormat, }); - await result.execute(); + await doLLMRequest(editor, chat, { + userPrompt: "translate to Spanish", + }); } catch (error: any) { errorThrown = true; caughtError = error; diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts index 859573178c..4b87db97f3 100644 --- a/packages/xl-ai/src/api/formats/json/json.test.ts +++ b/packages/xl-ai/src/api/formats/json/json.test.ts @@ -6,11 +6,10 @@ import { setupServer } from "msw/node"; import path from "path"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../../types.js"; -import { jsonLLMFormat } from "./json.js"; +import { llmFormats } from "../../index.js"; +import { promptAIRequestSender } from "../promptAIRequestSender.js"; const BASE_FILE_PATH = path.resolve( __dirname, @@ -114,20 +113,24 @@ describe.skip("Models", () => { describe(`${params.model.provider}/${params.model.modelId} (${ params.stream ? "streaming" : "non-streaming" })`, () => { - generateSharedTestCases((editor, options) => - doLLMRequest(editor, { - ...options, - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model: params.model, - maxRetries: 0, - stream: params.stream, - }), + generateSharedTestCases({ + streamToolsProvider: + llmFormats._experimental_json.getStreamToolsProvider({ + withDelays: false, }), - withDelays: false, - dataFormat: jsonLLMFormat, + aiRequestSender: promptAIRequestSender( + llmFormats._experimental_json.defaultPromptBuilder, + llmFormats._experimental_json.defaultPromptInputDataBuilder, + ), + transport: new ClientSideTransport({ + model: params.model, + stream: params.stream, + objectGeneration: true, + _additionalOptions: { + maxRetries: 0, + }, }), - ); + }); }); } }); diff --git a/packages/xl-ai/src/api/formats/json/json.ts b/packages/xl-ai/src/api/formats/json/json.ts index cceba2d5c3..47b8510b4b 100644 --- a/packages/xl-ai/src/api/formats/json/json.ts +++ b/packages/xl-ai/src/api/formats/json/json.ts @@ -1,34 +1,56 @@ import { BlockNoteEditor } from "@blocknote/core"; import { StreamTool } from "../../../streamTool/streamTool.js"; -import { defaultJSONPromptBuilder } from "./defaultJSONPromptBuilder.js"; + import { + defaultJSONPromptDataBuilder, getDataForPromptNoSelection, getDataForPromptWithSelection, } from "./jsonPromptData.js"; import { tools } from "./tools/index.js"; -function getStreamTools( +// Import the tool call types +import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; +import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; +import { DeleteBlockToolCall } from "../base-tools/delete.js"; +import { defaultJSONPromptBuilder } from "./defaultJSONPromptBuilder.js"; + +// Define the tool types +export type AddTool = StreamTool>; +export type UpdateTool = StreamTool>; +export type DeleteTool = StreamTool; + +// Create a conditional type that maps boolean flags to tool types +export type StreamToolsConfig = { + add?: boolean; + update?: boolean; + delete?: boolean; +}; + +export type StreamToolsResult = [ + ...(T extends { update: true } ? [UpdateTool] : []), + ...(T extends { add: true } ? [AddTool] : []), + ...(T extends { delete: true } ? [DeleteTool] : []), +]; + +function getStreamTools< + T extends StreamToolsConfig = { add: true; update: true; delete: true }, +>( editor: BlockNoteEditor, withDelays: boolean, - defaultStreamTools?: { - /** Enable the add tool (default: true) */ - add?: boolean; - /** Enable the update tool (default: true) */ - update?: boolean; - /** Enable the delete tool (default: true) */ - delete?: boolean; - }, + defaultStreamTools?: T, selectionInfo?: { from: number; to: number; }, -) { - const mergedStreamTools = { - add: true, - update: true, - delete: true, - ...defaultStreamTools, - }; + onBlockUpdate?: (blockId: string) => void, +): StreamToolsResult { + const mergedStreamTools = + defaultStreamTools ?? + ({ + add: true, + update: true, + delete: true, + } as T); const streamTools: StreamTool[] = [ ...(mergedStreamTools.update @@ -37,30 +59,54 @@ function getStreamTools( idsSuffixed: true, withDelays, updateSelection: selectionInfo, + onBlockUpdate, }), ] : []), ...(mergedStreamTools.add - ? [tools.add(editor, { idsSuffixed: true, withDelays })] + ? [tools.add(editor, { idsSuffixed: true, withDelays, onBlockUpdate })] : []), ...(mergedStreamTools.delete - ? [tools.delete(editor, { idsSuffixed: true, withDelays })] + ? [tools.delete(editor, { idsSuffixed: true, withDelays, onBlockUpdate })] : []), ]; - return streamTools; + return streamTools as StreamToolsResult; } -export const jsonLLMFormat = { +export const jsonBlockLLMFormat = { /** - * Function to get the stream tools that can apply BlockNote JSON block updates to the editor + * Function to get the stream tools that can apply JSON block updates to the editor */ - getStreamTools, + getStreamToolsProvider: ( + opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, + ) => ({ + getStreamTools: ( + editor: BlockNoteEditor, + selectionInfo?: { from: number; to: number }, + onBlockUpdate?: (blockId: string) => void, + ) => { + return getStreamTools( + editor, + opts.withDelays ?? true, + opts.defaultStreamTools, + selectionInfo, + onBlockUpdate, + ); + }, + }), + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) */ defaultPromptBuilder: defaultJSONPromptBuilder, + + /** + * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder + */ + defaultPromptInputDataBuilder: defaultJSONPromptDataBuilder, + /** * Helper functions which can be used when implementing a custom PromptBuilder */ diff --git a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts index 2ac81328f3..fe3392b4da 100644 --- a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts +++ b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts @@ -1,16 +1,48 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; +import { BlockNoteUserPrompt } from "../../../types.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; import { suffixIDs } from "../../promptHelpers/suffixIds.js"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; +export type JSONPromptData = ( + | Awaited> + | Awaited> +) & { + userPrompt: string; +}; + +export async function defaultJSONPromptDataBuilder( + editor: BlockNoteEditor, + blockNoteUserPrompt: BlockNoteUserPrompt, +) { + if (blockNoteUserPrompt.selectedBlocks) { + return { + ...(await getDataForPromptWithSelection(editor, { + selectedBlocks: blockNoteUserPrompt.selectedBlocks, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } else { + return { + ...(await getDataForPromptNoSelection(editor, { + excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete + ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + : undefined, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } +} + export async function getDataForPromptNoSelection( editor: BlockNoteEditor, opts: { excludeBlockIds?: string[]; }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const cursorBlockId = editor.getTextCursorPosition().block.id; const input = trimEmptyBlocks(editor.document, { cursorBlockId, @@ -30,7 +62,9 @@ export async function getDataForPromptNoSelection( ); const suffixed = suffixIDs(filtered); return { + selection: false as const, jsonBlocks: suffixed, + isEmptyDocument, }; } @@ -40,6 +74,7 @@ export async function getDataForPromptWithSelection( selectedBlocks: Block[]; }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const blockArray = await convertBlocks( flattenBlocks(opts.selectedBlocks), async (block) => { @@ -49,6 +84,8 @@ export async function getDataForPromptWithSelection( const suffixed = suffixIDs(blockArray); return { + isEmptyDocument, + selection: true as const, jsonSelectedBlocks: suffixed, jsonDocument: ( await convertBlocks(flattenBlocks(editor.document), async (block) => { diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts index 30210a743a..3aca075a98 100644 --- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts +++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts @@ -6,8 +6,7 @@ import { combinedOperationsTestCases } from "../../../../testUtil/cases/combined import { deleteOperationTestCases } from "../../../../testUtil/cases/deleteOperationTestCases.js"; import { DocumentOperationTestCase } from "../../../../testUtil/cases/index.js"; import { updateOperationTestCases } from "../../../../testUtil/cases/updateOperationTestCases.js"; -import { createAsyncIterableStreamFromAsyncIterable } from "../../../../util/stream.js"; -import { LLMResponse } from "../../../LLMResponse.js"; + import { AddBlocksToolCall } from "../../base-tools/createAddBlocksTool.js"; import { UpdateBlockToolCall } from "../../base-tools/createUpdateBlockTool.js"; import { DeleteBlockToolCall } from "../../base-tools/delete.js"; @@ -15,6 +14,8 @@ import { tools } from "./index.js"; // Helper function to create a mock stream from operations import { getAIExtension } from "../../../../AIExtension.js"; +import { StreamToolExecutor } from "../../../../streamTool/StreamToolExecutor.js"; +import { StreamTool } from "../../../../streamTool/streamTool.js"; import { getExpectedEditor } from "../../../../testUtil/cases/index.js"; import { validateRejectingResultsInOriginalDoc } from "../../../../testUtil/suggestChangesTestUtil.js"; @@ -56,21 +57,16 @@ async function executeTestCase( ...testCase.baseToolCalls.map((u) => ({ operation: u })), ); - // bit hacky way to instantiate an LLMResponse just so we can call execute - const result = new LLMResponse( - undefined as any, - createAsyncIterableStreamFromAsyncIterable(stream), - streamTools, - ); + const executor = new StreamToolExecutor(streamTools as StreamTool[]); // TODO: fix cast - await result.execute(); + await executor.execute(stream); + + await executor.waitTillEnd(); validateRejectingResultsInOriginalDoc(editor, originalDoc); getAIExtension(editor).acceptChanges(); expect(editor.document).toEqual(getExpectedEditor(testCase).document); - - return result; } describe("Add", () => { diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts index db69629c0c..155ea95405 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts @@ -1,50 +1,67 @@ import { UIMessage } from "ai"; -import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; import type { PromptBuilder } from "../PromptBuilder.js"; -import { - getDataForPromptNoSelection, - getDataForPromptWithSelection, -} from "./markdownPromptData.js"; +import { MarkdownPromptData } from "./markdownPromptData.js"; -function promptManipulateSelectionMarkdownBlocks(opts: { - userPrompt: string; - markdownSelectedBlocks: { - id: string; - block: string; - }[]; - markdownDocument: { - block: string; - }[]; - isEmptyDocument: boolean; -}): Array { - return [ +function promptManipulateSelectionMarkdownBlocks( + messages: UIMessage[], + opts: Exclude, +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "document-state-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):`, + }, + { + type: "text", + text: JSON.stringify(opts.markdownSelectedBlocks), + }, + { + type: "text", + text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:", + }, + { + type: "text", + text: JSON.stringify(opts.markdownDocument), + }, + ], + }, + { + role: "user", + id: "user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: "The user asks you to do the following:", + }, + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + } + + messages.push( { role: "system", - id: "markdown-selected-blocks", + id: "document-state-intro", parts: [ { type: "text", text: `You're manipulating a selected part of a text document using Markdown blocks. - Make sure to follow the json schema provided and always include the trailing $ in ids. - - This is the selection as an array of markdown blocks:`, + Make sure to follow the json schema provided and always include the trailing $ in ids. + This is the selection as an array of Markdown blocks:`, }, - ], - }, - { - role: "system", - id: "markdown-selected-blocks-json", - parts: [ { type: "text", text: JSON.stringify(opts.markdownSelectedBlocks), }, - ], - }, - { - role: "system", - id: "markdown-document", - parts: [ { type: "text", text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:", @@ -55,19 +72,9 @@ function promptManipulateSelectionMarkdownBlocks(opts: { }, ], }, - { - role: "system", - id: "markdown-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", - id: "markdown-user-prompt", + id: "user-prompt", parts: [ { type: "text", @@ -75,50 +82,57 @@ function promptManipulateSelectionMarkdownBlocks(opts: { }, ], }, - ]; + ); } -function promptManipulateDocumentUseMarkdownBlocks(opts: { - userPrompt: string; - markdownBlocks: Array< - | { - id: string; - block: string; - } - | { - cursor: true; - } - >; - isEmptyDocument: boolean; -}): Array { - return [ +function promptManipulateDocumentUseMarkdownBlocks( + messages: UIMessage[], + opts: Exclude, +): void { + if (messages.length > 0) { + messages.push( + { + role: "assistant", + id: "document-state-" + messages.length, + parts: [ + { + type: "text", + text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`, + }, + { + type: "text", + text: JSON.stringify(opts.markdownBlocks), + }, + ], + }, + { + role: "user", + id: "user-prompt-" + messages.length, + parts: [ + { + type: "text", + text: opts.userPrompt, + }, + ], + }, + ); + return; + } + messages.push( { role: "system", - id: "markdown-document", + id: "document-state", parts: [ { type: "text", text: `You're manipulating a text document using Markdown blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). - - This is the document as an array of markdown blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, + This is the initial document as an array of Markdown blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`, }, - ], - }, - { - role: "system", - id: "markdown-document-json", - parts: [ { type: "text", text: JSON.stringify(opts.markdownBlocks), }, - ], - }, - { - role: "system", - id: "markdown-user-prompt", - parts: [ { type: "text", text: @@ -134,19 +148,9 @@ function promptManipulateDocumentUseMarkdownBlocks(opts: { }, ], }, - { - role: "system", - id: "markdown-user-prompt", - parts: [ - { - type: "text", - text: "The user asks you to do the following:", - }, - ], - }, { role: "user", - id: "markdown-user-prompt", + id: "user-prompt", parts: [ { type: "text", @@ -154,151 +158,15 @@ function promptManipulateDocumentUseMarkdownBlocks(opts: { }, ], }, - ]; + ); } -export const defaultMarkdownPromptBuilder: PromptBuilder = async ( - editor, - opts, -) => { - const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; - - if (opts.selectedBlocks) { - const data = await getDataForPromptWithSelection(editor, { - selectedBlocks: opts.selectedBlocks, - }); - - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "markdown-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated selection. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.markdownSelectedBlocks), - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-document", - parts: [ - { - type: "text", - text: "This is the updated entire document:", - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-document-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.markdownDocument), - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "markdown-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateSelectionMarkdownBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); +export const defaultMarkdownPromptBuilder: PromptBuilder< + MarkdownPromptData +> = async (messages, inputData) => { + if (inputData.selection) { + promptManipulateSelectionMarkdownBlocks(messages, inputData); } else { - const data = await getDataForPromptNoSelection(editor, opts); - if (opts.previousMessages) { - return [ - ...opts.previousMessages, - { - role: "system", - id: "markdown-previous-response", - parts: [ - { - type: "text", - text: `After processing the previous response, this is the updated document. - Ignore previous documents, you MUST issue operations against this latest version of the document:`, - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-json", - parts: [ - { - type: "text", - text: JSON.stringify(data.markdownBlocks), - }, - ], - }, - { - role: "system", - id: "markdown-previous-response-user-prompt", - parts: [ - { - type: "text", - text: `You SHOULD use "update" operations to update blocks you added / edited previously - (unless the user explicitly asks you otherwise to add or delete other blocks). - - The user now asks you to do the following:`, - }, - ], - }, - { - role: "user", - id: "markdown-previous-response-user-prompt", - parts: [ - { - type: "text", - text: opts.userPrompt, - }, - ], - }, - ]; - } - - return promptManipulateDocumentUseMarkdownBlocks({ - ...data, - userPrompt: opts.userPrompt, - isEmptyDocument, - }); + promptManipulateDocumentUseMarkdownBlocks(messages, inputData); } }; diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts index 8cc2853c03..be36595a7a 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts @@ -5,12 +5,11 @@ import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; -import { createAISDKLLMRequestExecutor } from "../../../streamTool/vercelAiSdk/AISDKLLMRequestExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; -import { doLLMRequest } from "../../../types.js"; +import { llmFormats } from "../../index.js"; +import { promptAIRequestSender } from "../promptAIRequestSender.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; -import { markdownBlocksLLMFormat } from "./markdownBlocks.js"; const BASE_FILE_PATH = path.resolve( __dirname, @@ -114,26 +113,24 @@ describe("Models", () => { params.stream ? "streaming" : "non-streaming" })`, () => { generateSharedTestCases( - (editor, options) => - doLLMRequest(editor, { - ...options, - executor: createAISDKLLMRequestExecutor({ - transport: new ClientSideTransport({ - model: params.model, - maxRetries: 0, - stream: params.stream, - }), + { + streamToolsProvider: + llmFormats._experimental_markdown.getStreamToolsProvider({ + withDelays: false, }), - withDelays: false, - dataFormat: markdownBlocksLLMFormat, - // _generateObjectOptions: { - // providerOptions: { - // "albert-etalab": { - // guided_decoding_backend: "outlines", - // }, - // }, - // }, + aiRequestSender: promptAIRequestSender( + llmFormats._experimental_markdown.defaultPromptBuilder, + llmFormats._experimental_markdown.defaultPromptInputDataBuilder, + ), + transport: new ClientSideTransport({ + model: params.model, + stream: params.stream, + objectGeneration: true, + _additionalOptions: { + maxRetries: 0, + }, }), + }, // markdownblocks doesn't support these: { mentions: true, diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts index 3b0af6c164..2cb7e9e015 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts @@ -1,34 +1,56 @@ import { BlockNoteEditor } from "@blocknote/core"; import { StreamTool } from "../../../streamTool/streamTool.js"; -import { defaultMarkdownPromptBuilder } from "./defaultMarkdownPromptBuilder.js"; + import { getDataForPromptNoSelection, getDataForPromptWithSelection, } from "./markdownPromptData.js"; import { tools } from "./tools/index.js"; -function getStreamTools( +// Import the tool call types +import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; +import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; +import { DeleteBlockToolCall } from "../base-tools/delete.js"; +import { defaultMarkdownPromptBuilder } from "./defaultMarkdownPromptBuilder.js"; +import { defaultMarkdownPromptDataBuilder } from "./markdownPromptData.js"; + +// Define the tool types +export type AddTool = StreamTool>; +export type UpdateTool = StreamTool>; +export type DeleteTool = StreamTool; + +// Create a conditional type that maps boolean flags to tool types +export type StreamToolsConfig = { + add?: boolean; + update?: boolean; + delete?: boolean; +}; + +export type StreamToolsResult = [ + ...(T extends { update: true } ? [UpdateTool] : []), + ...(T extends { add: true } ? [AddTool] : []), + ...(T extends { delete: true } ? [DeleteTool] : []), +]; + +function getStreamTools< + T extends StreamToolsConfig = { add: true; update: true; delete: true }, +>( editor: BlockNoteEditor, withDelays: boolean, - defaultStreamTools?: { - /** Enable the add tool (default: true) */ - add?: boolean; - /** Enable the update tool (default: true) */ - update?: boolean; - /** Enable the delete tool (default: true) */ - delete?: boolean; - }, + defaultStreamTools?: T, selectionInfo?: { from: number; to: number; }, -) { - const mergedStreamTools = { - add: true, - update: true, - delete: true, - ...defaultStreamTools, - }; + onBlockUpdate?: (blockId: string) => void, +): StreamToolsResult { + const mergedStreamTools = + defaultStreamTools ?? + ({ + add: true, + update: true, + delete: true, + } as T); const streamTools: StreamTool[] = [ ...(mergedStreamTools.update @@ -37,30 +59,54 @@ function getStreamTools( idsSuffixed: true, withDelays, updateSelection: selectionInfo, + onBlockUpdate, }), ] : []), ...(mergedStreamTools.add - ? [tools.add(editor, { idsSuffixed: true, withDelays })] + ? [tools.add(editor, { idsSuffixed: true, withDelays, onBlockUpdate })] : []), ...(mergedStreamTools.delete - ? [tools.delete(editor, { idsSuffixed: true, withDelays })] + ? [tools.delete(editor, { idsSuffixed: true, withDelays, onBlockUpdate })] : []), ]; - return streamTools; + return streamTools as StreamToolsResult; } -export const markdownBlocksLLMFormat = { +export const markdownBlockLLMFormat = { /** - * Function to get the stream tools that can apply BlockNote Markdown block updates to the editor + * Function to get the stream tools that can apply Markdown block updates to the editor */ - getStreamTools, + getStreamToolsProvider: ( + opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, + ) => ({ + getStreamTools: ( + editor: BlockNoteEditor, + selectionInfo?: { from: number; to: number }, + onBlockUpdate?: (blockId: string) => void, + ) => { + return getStreamTools( + editor, + opts.withDelays ?? true, + opts.defaultStreamTools, + selectionInfo, + onBlockUpdate, + ); + }, + }), + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) */ defaultPromptBuilder: defaultMarkdownPromptBuilder, + + /** + * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder + */ + defaultPromptInputDataBuilder: defaultMarkdownPromptDataBuilder, + /** * Helper functions which can be used when implementing a custom PromptBuilder */ diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts index 91394e738d..328c85de6d 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts @@ -1,16 +1,48 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; +import { BlockNoteUserPrompt } from "../../../types.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; import { suffixIDs } from "../../promptHelpers/suffixIds.js"; import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js"; +export type MarkdownPromptData = ( + | Awaited> + | Awaited> +) & { + userPrompt: string; +}; + +export async function defaultMarkdownPromptDataBuilder( + editor: BlockNoteEditor, + blockNoteUserPrompt: BlockNoteUserPrompt, +) { + if (blockNoteUserPrompt.selectedBlocks) { + return { + ...(await getDataForPromptWithSelection(editor, { + selectedBlocks: blockNoteUserPrompt.selectedBlocks, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } else { + return { + ...(await getDataForPromptNoSelection(editor, { + excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete + ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + : undefined, + })), + userPrompt: blockNoteUserPrompt.userPrompt, + }; + } +} + export async function getDataForPromptNoSelection( editor: BlockNoteEditor, opts: { excludeBlockIds?: string[]; }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const cursorBlockId = editor.getTextCursorPosition().block.id; const input = trimEmptyBlocks(editor.document, { cursorBlockId, @@ -27,14 +59,19 @@ export async function getDataForPromptNoSelection( ); const suffixed = suffixIDs(filtered); return { + selection: false as const, markdownBlocks: suffixed, + isEmptyDocument, }; } export async function getDataForPromptWithSelection( editor: BlockNoteEditor, - opts: { selectedBlocks: Block[] }, + opts: { + selectedBlocks: Block[]; + }, ) { + const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0; const blockArray = await convertBlocks( flattenBlocks(opts.selectedBlocks), async (block) => { @@ -44,6 +81,8 @@ export async function getDataForPromptWithSelection( const suffixed = suffixIDs(blockArray); return { + isEmptyDocument, + selection: true as const, markdownSelectedBlocks: suffixed, markdownDocument: ( await convertBlocks(flattenBlocks(editor.document), async (block) => { diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 1176e81483..89e2303089 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -2,8 +2,8 @@ import { BlockNoteEditor } from "@blocknote/core"; import { StreamTool } from "../streamTool/streamTool.js"; import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; -import { jsonLLMFormat } from "./formats/json/json.js"; -import { markdownBlocksLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js"; +import { jsonBlockLLMFormat } from "./formats/json/json.js"; +import { markdownBlockLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js"; import { PromptBuilder } from "./formats/PromptBuilder.js"; export type StreamToolsProvider = { @@ -40,8 +40,8 @@ export type LLMFormat = { }; export const llmFormats = { - _experimental_json: jsonLLMFormat, - _experimental_markdown: markdownBlocksLLMFormat, + _experimental_json: jsonBlockLLMFormat, + _experimental_markdown: markdownBlockLLMFormat, html: htmlBlockLLMFormat, }; diff --git a/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx b/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx index 7f34040552..7165a19bbb 100644 --- a/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx +++ b/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx @@ -19,6 +19,7 @@ import { } from "react-icons/ri"; import { getAIExtension } from "../../AIExtension.js"; +import { llmFormats } from "../../api/index.js"; import { getAIDictionary } from "../../i18n/dictionary.js"; export type AIMenuSuggestionItem = Omit< @@ -51,11 +52,13 @@ function getDefaultAIMenuItemsWithoutSelection< userPrompt: "Continue writing at the current cursor position related to the previous text. Add multiple blocks if needed. If the document looks like a template / draft, follow the template. Be extensive if needed.", // By default, LLM will be able to add / update / delete blocks. For "continue writing", we only want to allow adding new blocks. - defaultStreamTools: { - add: true, - delete: false, - update: false, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: true, + delete: false, + update: false, + }, + }), }); }, size: "small", @@ -70,11 +73,13 @@ function getDefaultAIMenuItemsWithoutSelection< await ai.callLLM({ userPrompt: "Summarize", // By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks. - defaultStreamTools: { - add: true, - delete: false, - update: false, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: true, + delete: false, + update: false, + }, + }), }); }, size: "small", @@ -88,11 +93,13 @@ function getDefaultAIMenuItemsWithoutSelection< await ai.callLLM({ userPrompt: "Add action items", // By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks. - defaultStreamTools: { - add: true, - delete: false, - update: false, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: true, + delete: false, + update: false, + }, + }), }); }, size: "small", @@ -134,11 +141,13 @@ function getDefaultAIMenuItemsWithSelection< useSelection: true, userPrompt: "Improve writing", // By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks. - defaultStreamTools: { - add: false, - delete: false, - update: true, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: false, + delete: false, + update: true, + }, + }), }); }, size: "small", @@ -153,11 +162,13 @@ function getDefaultAIMenuItemsWithSelection< useSelection: true, userPrompt: "Fix spelling", // By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks. - defaultStreamTools: { - add: false, - delete: false, - update: true, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: false, + delete: false, + update: true, + }, + }), }); }, size: "small", @@ -182,11 +193,13 @@ function getDefaultAIMenuItemsWithSelection< useSelection: true, userPrompt: "Simplify", // By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks. - defaultStreamTools: { - add: false, - delete: false, - update: true, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: false, + delete: false, + update: true, + }, + }), }); }, size: "small", diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts index 6fb6fec697..9bcb82a973 100644 --- a/packages/xl-ai/src/streamTool/asTool.ts +++ b/packages/xl-ai/src/streamTool/asTool.ts @@ -1,6 +1,6 @@ import { jsonSchema, tool } from "ai"; import { createStreamToolsArraySchema } from "./jsonSchema.js"; -import { Result, StreamTool, StreamToolCall } from "./streamTool.js"; +import { StreamTool } from "./streamTool.js"; // TODO: remove or implement @@ -42,41 +42,3 @@ export function streamToolsAsTool[]>(streamTools: T) { // }, }); } - -// TODO: review -function operationsToStream[]>( - object: unknown, -): Result< - AsyncIterable<{ - partialOperation: StreamToolCall; - isUpdateToPreviousOperation: boolean; - isPossiblyPartial: boolean; - }> -> { - if ( - !object || - typeof object !== "object" || - !("operations" in object) || - !Array.isArray(object.operations) - ) { - return { - ok: false, - error: "No operations returned", - }; - } - const operations = object.operations; - async function* singleChunkGenerator() { - for (const op of operations) { - yield { - partialOperation: op, - isUpdateToPreviousOperation: false, - isPossiblyPartial: false, - }; - } - } - - return { - ok: true, - value: singleChunkGenerator(), - }; -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 444fdf8130..2959d0f84a 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -222,7 +222,7 @@ export class ClientSideTransport async sendMessages({ messages, - body, + // body, metadata, }: Parameters["sendMessages"]>[0]): Promise< ReadableStream diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 104b560bc0..0976d52f8d 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -191,14 +191,13 @@ export async function setupToolCallStreaming( }); }); - if (results.some((result) => result.status === "rejected")) { - throw new Error("Tool call failed"); - } - if (chat.error) { - // if there was an error, it's likely we already throwed it in the line above, - // however, theoretically there could be an error (e.g.: network error) in a message part after the last tool call - // in this case we still need to throw here + // response failed throw chat.error; } + + // response succeeded, but (one of the) tool calls failed + if (results.some((result) => result.status === "rejected")) { + throw new Error("Tool call failed"); + } } diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index 8f947507a8..bb408368bb 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -28,13 +28,7 @@ import { */ // based on https://github.com/vercel/ai/blob/d8ada0eb81e42633172d739a40c88e6c5a2f426b/packages/react/src/use-object.ts#L202 -export function textStreamToPartialObjectStream( - opts: { - chunks: boolean; - } = { - chunks: true, - }, -) { +export function textStreamToPartialObjectStream() { let accumulatedText = ""; let latestObject: DeepPartial | undefined = undefined; return new TransformStream>({ diff --git a/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts b/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts index 01bf9d44ff..e1543cb766 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/blockFormatting.ts @@ -22,11 +22,7 @@ export function getEditorWithBlockFormatting() { ], trailingBlock: false, schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); editor._tiptapEditor.forceEnablePlugins(); return editor; diff --git a/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts b/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts index 92bd606871..31baa6feef 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/emptyEditor.ts @@ -10,11 +10,7 @@ export function getEmptyEditor() { }, ], trailingBlock: false, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); editor._tiptapEditor.forceEnablePlugins(); return editor; diff --git a/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts b/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts index dc22e839d7..fb4f78f6ff 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/formattingAndMentions.ts @@ -72,11 +72,7 @@ export function getEditorWithFormattingAndMentions() { ], trailingBlock: false, schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); editor._tiptapEditor.forceEnablePlugins(); return editor; diff --git a/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts b/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts index 8776c340d4..ef0c26ebda 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/simpleEditor.ts @@ -16,11 +16,7 @@ export function getSimpleEditor() { ], trailingBlock: false, schema, - extensions: [ - createAIExtension({ - executor: undefined as any, - }), - ], + extensions: [createAIExtension({})], }); editor._tiptapEditor.forceEnablePlugins(); return editor; @@ -44,11 +40,7 @@ export function getSimpleEditorWithCursorBetweenBlocks() { ], trailingBlock: false, schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); editor.setTextCursorPosition("ref2"); editor._tiptapEditor.forceEnablePlugins(); diff --git a/packages/xl-ai/src/testUtil/cases/editors/tables.ts b/packages/xl-ai/src/testUtil/cases/editors/tables.ts index cf4f5d853a..1d33c2205d 100644 --- a/packages/xl-ai/src/testUtil/cases/editors/tables.ts +++ b/packages/xl-ai/src/testUtil/cases/editors/tables.ts @@ -38,11 +38,7 @@ export function getEditorWithTables() { ], schema, trailingBlock: false, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); editor._tiptapEditor.forceEnablePlugins(); return editor; diff --git a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts index 9292c27ac6..6d8ee4d852 100644 --- a/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts +++ b/packages/xl-ai/src/testUtil/cases/updateOperationTestCases.ts @@ -683,11 +683,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ }, ], schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); return editor; }, @@ -740,11 +736,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ }, ], schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); return editor; }, @@ -779,11 +771,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [ }, ], schema, - extensions: [ - createAIExtension({ - executor: undefined as any, // disable - }), - ], + extensions: [createAIExtension({})], }); return editor; }, From 0fde40bb6d99f63842da534ad3ad294cb9754314 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 19:24:53 +0200 Subject: [PATCH 32/68] fix lint --- packages/xl-ai/src/api/formats/tests/sharedTestCases.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts index 21f2d529a0..f90e3a4510 100644 --- a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts +++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts @@ -99,7 +99,7 @@ export function generateSharedTestCases( // granularity of the suggested changes. Can be enabled for debugging: // await matchFileSnapshot(editor.prosemirrorState.doc.toJSON()); - console.log(JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2)); + // console.log(JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2)); validateRejectingResultsInOriginalDoc(editor, originalDoc); // we first need to accept changes to get the correct result From 8fad3d23a7c6e180cfbaa5571dcb5a77e5d4b307 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 19:39:04 +0200 Subject: [PATCH 33/68] fix proxy --- packages/xl-ai-server/package.json | 2 +- packages/xl-ai-server/src/routes/vercelAiSdk.ts | 11 +++++++---- pnpm-lock.yaml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index 88289325c0..ee3e3767ad 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -46,7 +46,7 @@ "@hono/node-server": "^1.13.7", "hono": "^4.6.12", "ai": "^5.0.29", - "@blocknote/xl-ai": "workspace:*", + "@blocknote/xl-ai": "latest", "@ai-sdk/openai": "^2.0.23" }, "devDependencies": { diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index 1f4d470779..a5922d5a27 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -1,8 +1,8 @@ import { createOpenAI } from "@ai-sdk/openai"; import { createStreamToolsArraySchema, - objectToUIMessageStream, - partialObjectStreamToUIMessageStream, + objectAsToolCallInUIMessageStream, + partialObjectStreamAsToolCallInUIMessageStream, } from "@blocknote/xl-ai"; import { convertToModelMessages, @@ -65,7 +65,10 @@ vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { schema, }); - const stream = partialObjectStreamToUIMessageStream(result.fullStream); + const stream = partialObjectStreamAsToolCallInUIMessageStream( + result.fullStream, + "operations", + ); return createUIMessageStreamResponse({ stream }); }); @@ -81,7 +84,7 @@ vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { schema, }); - const stream = objectToUIMessageStream(result.object); + const stream = objectAsToolCallInUIMessageStream(result.object, "operations"); return createUIMessageStreamResponse({ stream }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c12f75d09..273de6d199 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4283,7 +4283,7 @@ importers: specifier: ^2.0.23 version: 2.0.23(zod@3.25.76) '@blocknote/xl-ai': - specifier: workspace:* + specifier: latest version: link:../xl-ai '@hono/node-server': specifier: ^1.13.7 From 454f3a9b6f7996e2b1eae58b03a3808eee91fd1d Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 22:07:22 +0200 Subject: [PATCH 34/68] fix build --- .../src/customAIMenuItems.tsx | 30 ++++++++++------- .../09-ai/05-manual-execution/src/App.tsx | 28 ++++++++++------ .../src/api/formats/html-blocks/htmlBlocks.ts | 32 +++++++++++++------ packages/xl-ai/src/api/formats/json/json.ts | 32 +++++++++++++------ .../formats/markdown-blocks/markdownBlocks.ts | 30 +++++++++++++---- packages/xl-ai/src/api/index.ts | 11 ++++--- 6 files changed, 112 insertions(+), 51 deletions(-) diff --git a/examples/09-ai/03-custom-ai-menu-items/src/customAIMenuItems.tsx b/examples/09-ai/03-custom-ai-menu-items/src/customAIMenuItems.tsx index 4752756416..1b7352f144 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/customAIMenuItems.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/customAIMenuItems.tsx @@ -1,5 +1,9 @@ import { BlockNoteEditor } from "@blocknote/core"; -import { AIMenuSuggestionItem, getAIExtension } from "@blocknote/xl-ai"; +import { + AIMenuSuggestionItem, + getAIExtension, + llmFormats, +} from "@blocknote/xl-ai"; import { RiApps2AddFill, RiEmotionHappyFill } from "react-icons/ri"; // Custom item to make the text more informal. @@ -24,11 +28,13 @@ export const makeInformal = ( // the selected content, so only `update` is set // to true. Defaults to `true` for all // operations. - defaultStreamTools: { - add: false, - delete: false, - update: true, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: false, + delete: false, + update: true, + }, + }), }); }, size: "small", @@ -52,11 +58,13 @@ export const addRelatedTopics = ( // In this case, we only want to allow adding new // content, so only `add` is set to true. // Defaults to `true` for all operations. - defaultStreamTools: { - add: true, - delete: false, - update: false, - }, + streamToolsProvider: llmFormats.html.getStreamToolsProvider({ + defaultStreamTools: { + add: true, + delete: false, + update: false, + }, + }), }); }, size: "small", diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx index ed9b485346..23a66d1cfe 100644 --- a/examples/09-ai/05-manual-execution/src/App.tsx +++ b/examples/09-ai/05-manual-execution/src/App.tsx @@ -62,7 +62,9 @@ export default function App() { // Let's get the stream tools so we can invoke them manually // In this case, we're using the default stream tools, which allow all operations - const tools = llmFormats.html.getStreamTools(editor, true); + const tools = llmFormats.html + .getStreamToolsProvider() + .getStreamTools(editor, true); // Create an executor that can execute StreamToolCalls const executor = new StreamToolExecutor(tools); @@ -91,10 +93,14 @@ export default function App() { // Let's get the stream tools so we can invoke them manually // In this case, we choose to only get the "update" tool - const tools = llmFormats.html.getStreamTools(editor, true, { - // only allow "update" operations - update: true, - }); + const tools = llmFormats.html + .getStreamToolsProvider({ + // only allow "update" operations + defaultStreamTools: { + update: true, + }, + }) + .getStreamTools(editor, true); // Create an executor that can execute StreamToolCalls const executor = new StreamToolExecutor(tools); @@ -150,10 +156,14 @@ export default function App() { // Let's get the stream tools so we can invoke them manually // In this case, we choose to only get the "update" tool - const tools = llmFormats.html.getStreamTools(editor, true, { - // only allow "update" operations - update: true, - }); + const tools = llmFormats.html + .getStreamToolsProvider({ + defaultStreamTools: { + // only allow "update" operations + update: true, + }, + }) + .getStreamTools(editor, true); // Create an executor that can execute StreamToolCalls const executor = new StreamToolExecutor(tools); diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index dd095f86dc..7f0d9812be 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -10,6 +10,7 @@ import { import { tools } from "./tools/index.js"; // Import the tool call types +import { StreamToolsProvider } from "../../index.js"; import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; import { DeleteBlockToolCall } from "../base-tools/delete.js"; @@ -38,12 +39,27 @@ function getStreamTools< editor: BlockNoteEditor, withDelays: boolean, defaultStreamTools?: T, - selectionInfo?: { - from: number; - to: number; - }, + selectionInfo?: + | { + from: number; + to: number; + } + | boolean, onBlockUpdate?: (blockId: string) => void, ): StreamToolsResult { + if (typeof selectionInfo === "boolean") { + const selection = selectionInfo + ? editor.getSelectionCutBlocks() + : undefined; + + selectionInfo = selection + ? { + from: selection._meta.startPos, + to: selection._meta.endPos, + } + : undefined; + } + const mergedStreamTools = defaultStreamTools ?? ({ @@ -80,12 +96,8 @@ export const htmlBlockLLMFormat = { */ getStreamToolsProvider: ( opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ) => ({ - getStreamTools: ( - editor: BlockNoteEditor, - selectionInfo?: { from: number; to: number }, - onBlockUpdate?: (blockId: string) => void, - ) => { + ): StreamToolsProvider => ({ + getStreamTools: (editor, selectionInfo, onBlockUpdate) => { return getStreamTools( editor, opts.withDelays ?? true, diff --git a/packages/xl-ai/src/api/formats/json/json.ts b/packages/xl-ai/src/api/formats/json/json.ts index 47b8510b4b..033b23e855 100644 --- a/packages/xl-ai/src/api/formats/json/json.ts +++ b/packages/xl-ai/src/api/formats/json/json.ts @@ -9,6 +9,7 @@ import { import { tools } from "./tools/index.js"; // Import the tool call types +import { StreamToolsProvider } from "../../index.js"; import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; import { DeleteBlockToolCall } from "../base-tools/delete.js"; @@ -38,12 +39,27 @@ function getStreamTools< editor: BlockNoteEditor, withDelays: boolean, defaultStreamTools?: T, - selectionInfo?: { - from: number; - to: number; - }, + selectionInfo?: + | { + from: number; + to: number; + } + | boolean, onBlockUpdate?: (blockId: string) => void, ): StreamToolsResult { + if (typeof selectionInfo === "boolean") { + const selection = selectionInfo + ? editor.getSelectionCutBlocks() + : undefined; + + selectionInfo = selection + ? { + from: selection._meta.startPos, + to: selection._meta.endPos, + } + : undefined; + } + const mergedStreamTools = defaultStreamTools ?? ({ @@ -80,12 +96,8 @@ export const jsonBlockLLMFormat = { */ getStreamToolsProvider: ( opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ) => ({ - getStreamTools: ( - editor: BlockNoteEditor, - selectionInfo?: { from: number; to: number }, - onBlockUpdate?: (blockId: string) => void, - ) => { + ): StreamToolsProvider => ({ + getStreamTools: (editor, selectionInfo, onBlockUpdate) => { return getStreamTools( editor, opts.withDelays ?? true, diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts index 2cb7e9e015..de71f63172 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts @@ -8,6 +8,7 @@ import { import { tools } from "./tools/index.js"; // Import the tool call types +import { StreamToolsProvider } from "../../index.js"; import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; import { DeleteBlockToolCall } from "../base-tools/delete.js"; @@ -38,12 +39,27 @@ function getStreamTools< editor: BlockNoteEditor, withDelays: boolean, defaultStreamTools?: T, - selectionInfo?: { - from: number; - to: number; - }, + selectionInfo?: + | { + from: number; + to: number; + } + | boolean, onBlockUpdate?: (blockId: string) => void, ): StreamToolsResult { + if (typeof selectionInfo === "boolean") { + const selection = selectionInfo + ? editor.getSelectionCutBlocks() + : undefined; + + selectionInfo = selection + ? { + from: selection._meta.startPos, + to: selection._meta.endPos, + } + : undefined; + } + const mergedStreamTools = defaultStreamTools ?? ({ @@ -80,10 +96,10 @@ export const markdownBlockLLMFormat = { */ getStreamToolsProvider: ( opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ) => ({ + ): StreamToolsProvider => ({ getStreamTools: ( - editor: BlockNoteEditor, - selectionInfo?: { from: number; to: number }, + editor, + selectionInfo, onBlockUpdate?: (blockId: string) => void, ) => { return getStreamTools( diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 89e2303089..9ac4d902b1 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -9,10 +9,13 @@ import { PromptBuilder } from "./formats/PromptBuilder.js"; export type StreamToolsProvider = { getStreamTools: ( editor: BlockNoteEditor, - selectionInfo?: { - from: number; - to: number; - }, + selectionInfo?: + | { + from: number; + to: number; + } + | boolean, + onBlockUpdate?: (blockId: string) => void, ) => StreamTool[]; }; export type LLMFormat = { From 927c3ebfaef1112b75b618ba22ab7fb738fcae1a Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 22:36:09 +0200 Subject: [PATCH 35/68] fix server calls --- .../09-ai/06-server-execution/src/App.tsx | 5 ++- .../xl-ai-server/src/routes/vercelAiSdk.ts | 41 ++++++++++--------- .../src/api/formats/promptAIRequestSender.ts | 12 +++--- .../clientside/ClientSideTransport.ts | 28 ++++++------- 4 files changed, 44 insertions(+), 42 deletions(-) diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx index 8e7c211449..47c0949194 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -41,8 +41,9 @@ export default function App() { // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) transport: new DefaultChatTransport({ - // Can also use /generateObject for non-streaming mode - api: `${BASE_URL}/streamObject`, + // Can also use /generateObject for object generation + non-streaming mode + // or /streamObject for object generation + streaming mode + api: `${BASE_URL}/streamText`, }), }), ], diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index a5922d5a27..09a16d0121 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -1,6 +1,5 @@ import { createOpenAI } from "@ai-sdk/openai"; import { - createStreamToolsArraySchema, objectAsToolCallInUIMessageStream, partialObjectStreamAsToolCallInUIMessageStream, } from "@blocknote/xl-ai"; @@ -8,10 +7,10 @@ import { convertToModelMessages, createUIMessageStreamResponse, generateObject, - generateText, jsonSchema, streamObject, streamText, + tool, } from "ai"; import { Hono } from "hono"; import { cors } from "hono/cors"; @@ -22,33 +21,35 @@ const model = createOpenAI({ apiKey: process.env.OPENAI_API_KEY, })("gpt-4o"); -// TODO: add support for generateText + tools -vercelAiSdkRoute.post("/generateText", cors(), async (c) => { - // TODO - const { messages } = await c.req.json(); +vercelAiSdkRoute.post("/generateText", cors(), async () => { + // can't easily convert generateText response to stream + // https://github.com/vercel/ai/issues/8380 + throw new Error("not implemented"); + // const { messages } = await c.req.json(); - const result = generateText({ - model, - messages: convertToModelMessages(messages), - tools: { - // add: tool({}), - }, - }); + // const result = generateText({ + // model, + // messages: convertToModelMessages(messages), + // tools: { + // // add: tool({}), + // }, + // }); - return result as any; + // return result as any; // return result.toDataStreamResponse(); }); -// TODO: add support for streamText + tools vercelAiSdkRoute.post("/streamText", cors(), async (c) => { - // TODO - const { messages } = await c.req.json(); + const { messages, streamTools } = await c.req.json(); const result = streamText({ model, messages: convertToModelMessages(messages), tools: { - // add: tool({}), + operations: tool({ + name: "operations", + inputSchema: jsonSchema(streamTools), + }), }, }); @@ -57,7 +58,7 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + const schema = jsonSchema(streamTools); const result = streamObject({ model, messages: convertToModelMessages(messages), @@ -75,7 +76,7 @@ vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + const schema = jsonSchema(streamTools); const result = await generateObject({ model, diff --git a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts index 698d8c9c98..fa3811a046 100644 --- a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts +++ b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts @@ -1,7 +1,9 @@ +import { createStreamToolsArraySchema } from "../../streamTool/jsonSchema.js"; import { AIRequestSender } from "../../types.js"; import { HTMLPromptData } from "./html-blocks/htmlPromptData.js"; import { PromptBuilder, PromptInputDataBuilder } from "./PromptBuilder.js"; +// TODO: naming export function promptAIRequestSender( promptBuilder: PromptBuilder, promptInputDataBuilder: PromptInputDataBuilder, @@ -20,11 +22,11 @@ export function promptAIRequestSender( // submit the AI request via the underlying transport to the LLM return aiRequest.chat.sendMessage(undefined, { ...options, - metadata: { - ...(options?.metadata ?? {}), - // TODO: metadata or body? - // TODO: where is this translated to JSON?? - streamTools: aiRequest.blockNoteUserPrompt.streamTools, + body: { + ...(options?.body ?? {}), + streamTools: createStreamToolsArraySchema( + aiRequest.blockNoteUserPrompt.streamTools, + ), }, }); }, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 2959d0f84a..78498d016c 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -9,10 +9,8 @@ import { jsonSchema, streamObject, streamText, + tool, } from "ai"; -import { streamToolsAsTool } from "../../asTool.js"; -import { createStreamToolsArraySchema } from "../../jsonSchema.js"; -import { StreamTool } from "../../streamTool.js"; import { objectAsToolCallInUIMessageStream, partialObjectStreamAsToolCallInUIMessageStream, @@ -68,7 +66,7 @@ export class ClientSideTransport */ protected async generateObject( messages: UIMessage[], - streamTools: StreamTool[], + streamToolJSONSchema: any, ) { const { model, _additionalOptions } = this.opts; @@ -76,7 +74,7 @@ export class ClientSideTransport throw new Error("model must be a LanguageModelV2"); } - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + const schema = jsonSchema(streamToolJSONSchema); const ret = await generateObject({ // non-overridable options for streamObject @@ -119,7 +117,7 @@ export class ClientSideTransport */ protected async streamObject( messages: UIMessage[], - streamTools: StreamTool[], + streamToolJSONSchema: any, ) { const { model, _additionalOptions } = this.opts; @@ -127,7 +125,7 @@ export class ClientSideTransport throw new Error("model must be a LanguageModelV2"); } - const schema = jsonSchema(createStreamToolsArraySchema(streamTools)); + const schema = jsonSchema(streamToolJSONSchema); const ret = streamObject({ // non-overridable options for streamObject @@ -172,17 +170,17 @@ export class ClientSideTransport * * This is the streaming version. */ - protected async streamText[]>( - messages: UIMessage[], - streamTools: T, - ) { + protected async streamText(messages: UIMessage[], streamToolJSONSchema: any) { const { model, _additionalOptions } = this.opts; const ret = streamText({ model, messages: convertToModelMessages(messages), tools: { - operations: streamToolsAsTool(streamTools), + operations: tool({ + name: "operations", + inputSchema: jsonSchema(streamToolJSONSchema), + }), }, // extra options for streamObject ...((_additionalOptions ?? {}) as any), @@ -222,12 +220,12 @@ export class ClientSideTransport async sendMessages({ messages, - // body, - metadata, + body, + // metadata, }: Parameters["sendMessages"]>[0]): Promise< ReadableStream > { - const streamTools = (metadata as any).streamTools; + const streamTools = (body as any).streamTools; if (this.opts.objectGeneration) { if (this.opts.stream) { From 25882f4cf3263673e3e92852fcaec1a0f30187b2 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 23:14:51 +0200 Subject: [PATCH 36/68] gen --- examples/09-ai/06-server-execution/tsconfig.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/09-ai/06-server-execution/tsconfig.json b/examples/09-ai/06-server-execution/tsconfig.json index 3b74ef215c..9aa203fa0f 100644 --- a/examples/09-ai/06-server-execution/tsconfig.json +++ b/examples/09-ai/06-server-execution/tsconfig.json @@ -19,15 +19,12 @@ "composite": true }, "include": ["."], - "references": [ + "__ADD_FOR_LOCAL_DEV_references": [ { "path": "../../../packages/core/" }, { "path": "../../../packages/react/" - }, - { - "path": "../../../packages/xl-ai/" } ] } From bd17293611d3ee8a4540bc3f5444c0423da73221 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 23:14:53 +0200 Subject: [PATCH 37/68] gen --- playground/src/examples.gen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 560652e84c..46c42127ab 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1539,7 +1539,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^4.1.0", + ai: "^5.0.29", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", From c416a9b6d6a861dd0763def5e9e71f1cd9bc2d10 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 23:39:31 +0200 Subject: [PATCH 38/68] fix tests --- ...block_1_0e5edfd25f60308e612767de12847e8d.json} | 4 ++-- ...(end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json} | 4 ++-- ... doc)_1_96826a43db728a07477682898c006eec.json} | 4 ++-- ...(end)_1_c1da093b93c714a83bb7c0d1ddd97412.json} | 4 ++-- ...tart)_1_be93e9492f5031d7a78c65393f7a1d75.json} | 4 ++-- ... block_1_306ab5e8c98c3d3fdac6887befcd68fd.json | 15 --------------- ... block_1_300c17e9dfe4cc39a90237be3727f6c5.json | 15 --------------- ... block_1_00c42d9142f46a774249f0ea4c83087e.json | 15 --------------- ... (end)_1_893055235ef87ad63966a8c0356f9ed2.json | 15 --------------- ...y doc)_1_7af724b09a7de255b40b070289b6dd5c.json | 15 --------------- ... (end)_1_101445be13e5db1922d2422ca47b6666.json | 15 --------------- ...start)_1_f162fc6430cd63574f46ab6d4fcc9276.json | 15 --------------- ... block_1_4fd0655be71caae6b7983603e51af51c.json | 15 +++++++++++++++ ... block_1_636c346a04a30c96e2c1c249332f8c03.json | 15 --------------- ... (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json | 15 --------------- ... (end)_1_db7fbffbd0451f36b760272fc5d21981.json | 15 +++++++++++++++ ...y doc)_1_5153f1102c266fbdae2a57a0daf45d18.json | 15 --------------- ...y doc)_1_ec679341141937cec2df7a1a2a6719ba.json | 15 +++++++++++++++ ... (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json | 15 --------------- ... (end)_1_e92ffb458c4c624adaf290660d5e7773.json | 15 +++++++++++++++ ...start)_1_7c24b8f8171deedb5438290ebfa67ae1.json | 15 --------------- ...start)_1_7d5253a97f3f342003e32ab92acfff29.json | 15 +++++++++++++++ ... block_1_3139b296f45dc96c7f91c1f262392d80.json | 15 +++++++++++++++ ... block_1_99059264437bec6dfb23fc667f1faf5e.json | 15 --------------- ... (end)_1_97ee12aa97bd6b477bbea182b59027ed.json | 15 +++++++++++++++ ... (end)_1_ba651e401645ce4adc5ee557436f8b23.json | 15 --------------- ...y doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json | 15 +++++++++++++++ ...y doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json | 15 --------------- ... (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json | 15 --------------- ... (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json | 15 +++++++++++++++ ...start)_1_27593d2fa262011d9360c89049abc9a0.json | 15 +++++++++++++++ ...start)_1_ccaa26a39b8dce298abdf194e096f42d.json | 15 --------------- ...agraph_1_0e188d2a921d6dac6d6e40274fb58e46.json | 15 --------------- ...agraph_1_41ff47b4fca8d8385d05699430391371.json | 15 --------------- ...agraph_1_9c13225608eaccf4da63366cc1408a11.json | 15 +++++++++++++++ ...ection_1_39cf1461b71867689c0f440d8bd07a16.json | 15 --------------- ...ection_1_5f7ae491c3449ea3417bff42c10f4c5f.json | 15 --------------- ...ection_1_c3195620bef1082a4598d4a1033f35e2.json | 15 +++++++++++++++ ...agraph_1_2d61c5a123cae75fe48d74bf26f033a3.json | 15 --------------- ...ection_1_e1aca3374c81381183ce604542843900.json | 15 --------------- ...agraph_1_607d4d9f46629e45f3851adc6d41d4c2.json | 15 --------------- ...ection_1_8d3b49c53bee6f8c6b3ec838d43e9443.json | 15 --------------- ...agraph_1_01e68b70cd8cdf6436f9b06f75ac269d.json | 15 --------------- ...ection_1_96437051f6bbcb1c7a6e75501a1c3693.json | 15 --------------- ...agraph_1_4b4bc6bf80353f21d3b81a63e9f3ef54.json | 15 --------------- ...ection_1_40c00fd5cd485b1554b63a856d0ca2b3.json | 15 --------------- ...agraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json | 15 +++++++++++++++ ...agraph_1_851b7242fd29b343abb0a86c005bb650.json | 15 --------------- ...ection_1_2260e18485e60399528d870f6f325109.json | 15 +++++++++++++++ ...ection_1_9a144ecbde0b871de374e8ca0e3fa323.json | 15 --------------- ...agraph_1_a2b5d52e84a94b234db1603ce5f800e4.json | 15 +++++++++++++++ ...agraph_1_c684f68b8f8b674dba89187794598da7.json | 15 --------------- ...ection_1_837eb32ef792caa67d1aaa4f9b7d7b91.json | 15 --------------- ...ection_1_c6fb82e817b9dad69fb7d7369cac5784.json | 15 +++++++++++++++ ... block_1_05fca597808a6f25433ca045a5ef0559.json | 15 +++++++++++++++ ... block_1_80e6e86a31a71d50adeb8404f21c8dfa.json | 15 --------------- ... block_1_be4abe78f0900318e7f02b64cd567b48.json | 15 --------------- ... block_1_12e70268f615c2e6a251a0c822f5c852.json | 15 --------------- ... block_1_af6efe0bca3582e6c8ff21ffc13eba7b.json | 15 --------------- ... block_1_732c937802aaa089d01c37b91dcac697.json | 15 --------------- ... block_1_30efafef9e27f70713ac6d216c71f723.json | 15 --------------- ... block_1_43b215e15138f6f142a80fd451a58b29.json | 15 --------------- ... block_1_7d6b50b0908779f526df2beeed42aa33.json | 15 +++++++++++++++ ... block_1_1cd1e0ebf217dc48b3b49ec536911be8.json | 15 --------------- ... block_1_7d7fb0886f56d21ab74ae5ff29dba403.json | 15 +++++++++++++++ ...atting_1_301b672f7c4cbdd034fe74e9c3166861.json | 15 --------------- ...n mark_1_cb7bb5a13c260e01317448090595ee0e.json | 15 +++++++++++++++ ...n mark_1_d428f1cf0fef38221f6d7b182d72628d.json | 15 --------------- ...n mark_1_f6366ff3ba630d781bc34e5504b23982.json | 15 --------------- ...d link_1_8b0fe73e448aa675279e4dba4a804d78.json | 15 +++++++++++++++ ...d link_1_db4f1c714b34a8689f89cf2ea74dd9b1.json | 15 --------------- ...ntent_1_488a0d087a0b1e01688f51ae05a3914b.json} | 4 ++-- ...ntent_1_c0db573b1364fb7c190c2ff2790eb1d2.json} | 4 ++-- ...ention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json | 15 --------------- ...ention_1_5ff3afb37a8323d9237d5b95694febb8.json | 15 --------------- ...ention_1_79671ea4a1807abe2acdbdbdc8d1a592.json | 15 +++++++++++++++ ...update_1_c21d0b742de489f48d10cdb0a2368742.json | 15 --------------- ...update_1_d11897eebf4af50b80d9b0af2a1cc076.json | 15 +++++++++++++++ ...e mark_1_04e5b18dcbf265726fc60add5d49579b.json | 15 --------------- ...e mark_1_4b283890bf3b97be66a19afe638bf182.json | 15 +++++++++++++++ ...e mark_1_ec0dc498f9751250aea1a983b178f851.json | 15 --------------- ...ention_1_011d7335e3bc7e40685788d29b8995fd.json | 15 --------------- ...ention_1_228afd96384806beba53490617ca02ad.json | 15 +++++++++++++++ ...ention_1_a3b05a1abb86f585d47c391999382e50.json | 15 --------------- ...ontent_1_b2084dd7f9c0ddf8d8069245f9724d2e.json | 15 --------------- ...ontent_1_d250c0dfa1fc195c3dcd0e1339c06849.json | 15 +++++++++++++++ ...ontent_1_e6a5964ece38842634196e2158af46a5.json | 15 --------------- ...n prop_1_bd32f736daf0ace65c5ef96f85d33073.json | 15 --------------- ...n prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json | 15 +++++++++++++++ ...n prop_1_d36fe6fd5c56cbb5720b8b5f0f1af4de.json | 15 --------------- ...e text_1_00262aa7e2e7a3dbe561b186222af294.json | 15 +++++++++++++++ ...e text_1_166f3480a334b0bb61dd9f71725161c7.json | 15 --------------- ...e text_1_29398a2d44edd12095a50d62bd1bf720.json | 15 --------------- ...graph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json | 15 --------------- ...graph)_1_664975f8855764c9de57ed1aef74e740.json | 15 --------------- ...graph)_1_8574c26a2e0ef804975798372b6f76c4.json | 15 +++++++++++++++ ...(word)_1_6f48d6dae797621870e22e8e0f572003.json | 15 --------------- ...(word)_1_732a538612df511185897838aca811b7.json | 15 --------------- ...word)_1_f4a2bc31383bc00faef808d2933ace4d.json} | 4 ++-- ...ection_1_093561699e181778eacfcf52c5b5bce5.json | 15 --------------- ...ection_1_8fa2a7559da234ea5baba7e27d421e2e.json | 15 --------------- ...ection_1_f71f92a2a9a3611028a28c1c24dde70d.json | 15 +++++++++++++++ ... list_1_66a84f6298bb99ee6a647822879b2039.json} | 4 ++-- ...ontent_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json | 15 --------------- ...k prop_1_b37458e2a024cdda800f9b97dfbb7d95.json | 15 --------------- ...ontent_1_1b323a77f9c477ec6dc7e0538d496bee.json | 15 +++++++++++++++ ...ontent_1_1eecd846715894269bcff0f0c8809dab.json | 15 --------------- ...ontent_1_766a8e965e9476fd9073925774f2b18e.json | 15 --------------- ...k type_1_4ab38e1cedf41335ad0b75647aa29f9a.json | 15 +++++++++++++++ ...k type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json | 15 --------------- ...k type_1_9abd187cb14c5c3012da9eac6dff51ad.json | 15 --------------- ...atting_1_350ecafb238090fa055692a72ae42198.json | 15 --------------- ...n mark_1_4c51960ed572671e7cf73db4566e3d99.json | 15 --------------- ...d link_1_7a6d23fe91e74cf9675ae6e6124fd126.json | 15 --------------- ...ention_1_01fbf08ac456e3dbbd64103c41f21a4d.json | 15 --------------- ...update_1_51020afd3498ab35dc016c36e1e0c6b8.json | 15 --------------- ...e mark_1_ad61d6ba098240616fe2106324f993e4.json | 15 --------------- ...ention_1_75f14cc4df749a9a1a0a838d62ae2678.json | 15 --------------- ...ontent_1_35f272b43423355f2a5dbbd1e49b4366.json | 15 --------------- ...n prop_1_f60fdbb256106a235e820360bc2195ca.json | 15 --------------- ...e text_1_5853e0d779926ddd5b628ed248c652f0.json | 15 --------------- ...graph)_1_865f7c1246731fba1044fe8d23bfab53.json | 15 --------------- ...(word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json | 15 --------------- ...ection_1_e40023b9b9cf64ea508c42520ce54a92.json | 15 --------------- ...ontent_1_5a277f291beced18ef6642e6452c04f8.json | 15 --------------- ...k prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json | 15 --------------- ...ontent_1_808d14b549ccb577b7baa1c33e8433d1.json | 15 --------------- ...k type_1_16f9143c5a28bfa65954cba662a9e644.json | 15 --------------- ...atting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json | 15 --------------- ...n mark_1_f67f3cef3589a8792080e7fb090b1226.json | 15 --------------- ...d link_1_9056181b23b2cd23325d52c3eeb6ee16.json | 15 --------------- ...ention_1_5ac53cae2b0994f5de466affabaad58e.json | 15 --------------- ...update_1_a534dfa8d9008a473a02fcb64bd645c7.json | 15 --------------- ...e mark_1_db0b2afe5c635db1fbd2fd9e5c66c2a6.json | 15 --------------- ...ention_1_698e87bd13c88c31da2b4d97ed62aa8a.json | 15 --------------- ...ontent_1_54e5c87345fd2adc7bc1aa015fb7ed49.json | 15 --------------- ...n prop_1_fc03fd7d02657b4546b13e3e8a3a2bee.json | 15 --------------- ...e text_1_ae27bd5c696279c7555747ebab7f882e.json | 15 --------------- ...graph)_1_ad1bbdc50acb8c57cbcb55e00134b956.json | 15 --------------- ...(word)_1_f65378b4068dbaa6e4b2f12247582a3d.json | 15 --------------- ...ection_1_a4057cb73ed9ba6b58bfc3440182ab52.json | 15 --------------- ...ontent_1_cd366ecb6835f6ad416e56246d772258.json | 15 --------------- ...k prop_1_dcd828e95a6f35a02dc80f83ce865246.json | 15 --------------- ...ontent_1_b409676f3c38fab14dbfcf469c084b61.json | 15 --------------- ...k type_1_8035279de2d825570eb857243ac085d3.json | 15 --------------- ...atting_1_4220ed611dd1396b8eaefaef1a93aa3d.json | 15 --------------- ...n mark_1_5752bbf6a6ab425496886ae0c16fa252.json | 15 --------------- ...d link_1_fc4c8d212e083aeb086ecc97f89172cc.json | 15 --------------- ...ention_1_a5a6fbbb73ac75d5318976205c211175.json | 15 --------------- ...update_1_55ce5796bcf58df91ac364bf5da3c062.json | 15 --------------- ...e mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json | 15 --------------- ...ention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json | 15 --------------- ...ontent_1_90cbcfafa2e6f6897e82793db3d31620.json | 15 --------------- ...n prop_1_1f44d9313ad815027c9c904006e12c1f.json | 15 --------------- ...e text_1_412767e25cd81b316089d06262ab5f8f.json | 15 --------------- ...graph)_1_357e3e9924f91ecb50a561b8373474f2.json | 15 --------------- ...ection_1_169e840a93c457a3980841bce584f8b4.json | 15 --------------- ...ontent_1_3121104fb353eb2bca2395575f057107.json | 15 --------------- ...k prop_1_fe9102e572088ab37c69a84ef83a452c.json | 15 --------------- ...ontent_1_62527380200c30745a8e04e2aa459e3d.json | 15 --------------- ...k type_1_3236a5c1b691839e51b0cd3787a7947f.json | 15 --------------- ...atting_1_43253dee16b03b1f16101ced5bddfc93.json | 15 --------------- ...n mark_1_92fde43139365369266b63a2b6e2d0b2.json | 15 --------------- ...d link_1_8336a355b6037db27d810a3f3a2fdb9c.json | 15 --------------- ...ontent_1_0e25723621acc3c5e0fa98bbbc1b8426.json | 15 --------------- ...ontent_1_329ea2aac9bc7887fb77b9165483286c.json | 15 --------------- ...ention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json | 15 --------------- ...update_1_aed8c5658597a148c7fe740ef98aa03d.json | 15 --------------- ...e mark_1_bd46c569d016618aeacaa2514b6f4906.json | 15 --------------- ...ention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json | 15 --------------- ...ontent_1_1ba1a4b5441db5f015f9ef75218f87a3.json | 15 --------------- ...n prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json | 15 --------------- ...e text_1_97807fd69b67c1c3e79e678fba3ecfcd.json | 15 --------------- ...graph)_1_d6c7f981af0a2837c6cd85da3d297974.json | 15 --------------- ...(word)_1_8ead2588e1bc1366b02cfded465fc8d4.json | 15 --------------- ...ection_1_c2c3a06cd8eb6901e2007575eca77530.json | 15 --------------- ...o list_1_8ae508a1ba8354be0703f5bc89561691.json | 15 --------------- ...ontent_1_e0330a1df29640d9ff657ad9037bc203.json | 15 --------------- ...k prop_1_673b8e9ca4d59db999abd61ed34ec305.json | 15 --------------- ...ontent_1_605daff442fc8684c6d126269f2aba3b.json | 15 --------------- ...k type_1_78e5c1f637c725aef379fd2b7f7551bf.json | 15 --------------- ...n mark_1_ce3471aa159401d181a031a94f536a6f.json | 15 --------------- ...n mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json | 15 +++++++++++++++ ...d link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json | 15 +++++++++++++++ ...d link_1_a013185ff454fa613135a1d2aae8e0cd.json | 15 --------------- ...ontent_1_bfc978f4d5fa050140ca2c1bf5a99e37.json | 15 +++++++++++++++ ...ontent_1_ee6053865d15c053ac6b94f0cf5ffd17.json | 15 --------------- ...ontent_1_cf634699b3239ed229f0b69543118654.json | 15 --------------- ...ontent_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json | 15 +++++++++++++++ ...ention_1_7b34734780def271970ecaef1786138c.json | 15 --------------- ...ention_1_7eefe9f91a0f30ff02b536d713a150da.json | 15 +++++++++++++++ ...update_1_6efde673f529b56639c3a083147525ed.json | 15 +++++++++++++++ ...update_1_e447a0275121e64f7e8970883902c014.json | 15 --------------- ...e mark_1_4f669f245ffae48dbb6b753c6e4ea671.json | 15 +++++++++++++++ ...e mark_1_a8a9a847cc8f56ae71bab8677082b908.json | 15 --------------- ...ention_1_606370cd230fb0aa57852541e2826c16.json | 15 --------------- ...ention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json | 15 +++++++++++++++ ...ontent_1_02ee54eac49ee27796690079ae102928.json | 15 --------------- ...ontent_1_0819b3d657557550110223569d969fba.json | 15 +++++++++++++++ ...n prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json | 15 --------------- ...n prop_1_e4c1051180bfd61bc46515e8f902adab.json | 15 +++++++++++++++ ...e text_1_08ae00872a9f2c6f8b2a5e12758444bd.json | 15 --------------- ...e text_1_c8a95723767bd6bbda955b9c97bb9655.json | 15 +++++++++++++++ ...graph)_1_87799e0afe80a948ff1c538b8de016a8.json | 15 +++++++++++++++ ...graph)_1_c158abbfeb39cd0079a2e558305693dd.json | 15 --------------- ...(word)_1_9102cbc1c53c062212b17b10050f9b05.json | 15 --------------- ...(word)_1_c536370803c8d5b8e925f1cbc94df24e.json | 15 +++++++++++++++ ...ection_1_1479fba33d2f5126867fd3a9d73e37f4.json | 15 --------------- ...ection_1_98ad26809047752edacacdefcb28793e.json | 15 +++++++++++++++ ...o list_1_b52b1a76b761a53c8fa407c280c1768f.json | 15 +++++++++++++++ ...o list_1_d5cefdf40285a9390452e873ce6cf64d.json | 15 --------------- ...ontent_1_897a33c5523c928b3293cbff3b4b61b4.json | 15 --------------- ...ontent_1_d9b21d6453f43da1a720fbbeffd1a49a.json | 15 +++++++++++++++ ...k type_1_9f0d14a9822c996470cda6abb86cd593.json | 15 --------------- ...k type_1_f198c01d3ae7a854d3ee6112e9912e6d.json | 15 +++++++++++++++ ...n mark_1_5d10b789913219b679fdf022143d076d.json | 15 +++++++++++++++ ...n mark_1_9c740a830526aae5c1681140dbffce61.json | 15 --------------- ...d link_1_9d2ea9b77f66167634b2565bccc1fcd3.json | 15 --------------- ...d link_1_eacbe4b67ed506fb59e038041ae07f63.json | 15 +++++++++++++++ ...ontent_1_66432f1424f3d197bb56fb91afdcb4cb.json | 15 +++++++++++++++ ...ontent_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json | 15 --------------- ...ontent_1_119bf064d3d052e2c1894b98d02f4f7e.json | 15 +++++++++++++++ ...ontent_1_13fbb3be256ec82e826b622cdcae5247.json | 15 --------------- ...ention_1_1464bc74169f4b71758856010869e6bc.json | 15 +++++++++++++++ ...ention_1_9ac28fa826d75634499518503f07c102.json | 15 --------------- ...update_1_896f5d4e6e06b37d71e5b24ccff257b7.json | 15 --------------- ...update_1_db7cad0db1ad4f96b7a12f28b5564d95.json | 15 +++++++++++++++ ...e mark_1_765368819c77871f23a56edfe3041c90.json | 15 --------------- ...e mark_1_e3cfb9691a5e35b717f161fbbca0340e.json | 15 +++++++++++++++ ...ention_1_143aabdf8ac21ed460c808ebc490c41d.json | 15 --------------- ...ention_1_d224b9d8b477962fb9264d15a0c91fef.json | 15 +++++++++++++++ ...ontent_1_2d4c1e5b3b1498596445e7a3cb2c915c.json | 15 --------------- ...ontent_1_62e4ad823a1b8dc9eefa6f207b166b74.json | 15 +++++++++++++++ ...n prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json | 15 --------------- ...n prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json | 15 +++++++++++++++ ...e text_1_1c22626de0e444ba6765152158a82c06.json | 15 --------------- ...e text_1_9c3a4bff186e595440356fe0647f9b31.json | 15 +++++++++++++++ ...graph)_1_23860fc29605f9328d6e0b5beceedd02.json | 15 --------------- ...graph)_1_e0e8269f15fb096e2eeda797c350c1e5.json | 15 +++++++++++++++ ...(word)_1_b97a16df8573048752520fd36bfc321c.json | 15 +++++++++++++++ ...(word)_1_fce264c033bc4b8dc3ab4110f96211a9.json | 15 --------------- ...ection_1_6bec6487dfe642d6607cbac3e3567c9b.json | 15 +++++++++++++++ ...ection_1_de89161ffe07c2ee9d023475081863c1.json | 15 --------------- ...o list_1_195ecfa59c77a5af5b5ce68d4385de24.json | 15 +++++++++++++++ ...o list_1_8729fe16c66e8648ade70660e5914c0e.json | 15 --------------- ...ontent_1_a23db5d3055574260d8823221d560ba8.json | 15 --------------- ...ontent_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json | 15 +++++++++++++++ ...k type_1_805bfc82ee9253bcb1cd35617f17fc4d.json | 15 --------------- ...k type_1_d07f1cc16fc9441210ee33277c409acd.json | 15 +++++++++++++++ 249 files changed, 1008 insertions(+), 2628 deletions(-) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json => Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json} (58%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a list (end)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json => add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (empty doc)_1_c7d6978b09036961e8430bbe8403e402.json => add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (end)_1_1de04509d43d719c355118e54aac5695.json => add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{add a new paragraph (start)_1_490bd381faa3237b3e0100bc2f4a41e9.json => add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json} (81%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_306ab5e8c98c3d3fdac6887befcd68fd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_300c17e9dfe4cc39a90237be3727f6c5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_00c42d9142f46a774249f0ea4c83087e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_893055235ef87ad63966a8c0356f9ed2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_7af724b09a7de255b40b070289b6dd5c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_f162fc6430cd63574f46ab6d4fcc9276.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_0e188d2a921d6dac6d6e40274fb58e46.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_5f7ae491c3449ea3417bff42c10f4c5f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_2d61c5a123cae75fe48d74bf26f033a3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_e1aca3374c81381183ce604542843900.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_607d4d9f46629e45f3851adc6d41d4c2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_8d3b49c53bee6f8c6b3ec838d43e9443.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_01e68b70cd8cdf6436f9b06f75ac269d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_96437051f6bbcb1c7a6e75501a1c3693.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_4b4bc6bf80353f21d3b81a63e9f3ef54.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_40c00fd5cd485b1554b63a856d0ca2b3.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json delete mode 100644 packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json create mode 100644 packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_be4abe78f0900318e7f02b64cd567b48.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_12e70268f615c2e6a251a0c822f5c852.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_af6efe0bca3582e6c8ff21ffc13eba7b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_732c937802aaa089d01c37b91dcac697.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_30efafef9e27f70713ac6d216c71f723.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/clear block formatting_1_301b672f7c4cbdd034fe74e9c3166861.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_d428f1cf0fef38221f6d7b182d72628d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_db4f1c714b34a8689f89cf2ea74dd9b1.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json => modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json} (81%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json => modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json} (80%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_5ff3afb37a8323d9237d5b95694febb8.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_ec0dc498f9751250aea1a983b178f851.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_a3b05a1abb86f585d47c391999382e50.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_b2084dd7f9c0ddf8d8069245f9724d2e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_d36fe6fd5c56cbb5720b8b5f0f1af4de.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_29398a2d44edd12095a50d62bd1bf720.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_664975f8855764c9de57ed1aef74e740.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_6f48d6dae797621870e22e8e0f572003.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json => styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json} (53%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_093561699e181778eacfcf52c5b5bce5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/{turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json => turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json} (76%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop_1_b37458e2a024cdda800f9b97dfbb7d95.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1eecd846715894269bcff0f0c8809dab.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_f67f3cef3589a8792080e7fb090b1226.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_9056181b23b2cd23325d52c3eeb6ee16.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_5ac53cae2b0994f5de466affabaad58e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_a534dfa8d9008a473a02fcb64bd645c7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_db0b2afe5c635db1fbd2fd9e5c66c2a6.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_698e87bd13c88c31da2b4d97ed62aa8a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_54e5c87345fd2adc7bc1aa015fb7ed49.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_fc03fd7d02657b4546b13e3e8a3a2bee.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_ae27bd5c696279c7555747ebab7f882e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_ad1bbdc50acb8c57cbcb55e00134b956.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f65378b4068dbaa6e4b2f12247582a3d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_a4057cb73ed9ba6b58bfc3440182ab52.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_cd366ecb6835f6ad416e56246d772258.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_dcd828e95a6f35a02dc80f83ce865246.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_b409676f3c38fab14dbfcf469c084b61.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_8035279de2d825570eb857243ac085d3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json index 220691599f..437b895981 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_65f04fd42a04dcca12de00a733958f35.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_013jmjxYsZVSzmnRiKPk6BsV\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01NT36p1DCDvxkhP7cGL5EPJ\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

Code

\",\"
console.log('hello world');
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1080,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":107,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_016MRgf9GPFVrnUEhg1BtKgq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01E21HvW6wNrk5DENFt89MuC\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

Code

\",\"
console.log('hello world');
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1090,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":107,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json index ce369d6315..ba921e1289 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_0ed983e6c0eeabc6d1e872e3c4755f17.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_012HGxPJQqPKyWKJG1CEcWuP\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_018sBzgZWybGg46SqrJLaHEd\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"
  • Apples
\",\"
  • Bananas
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1073,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":94,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01XWt3QnGdaqrMDPp7Crcq9M\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01RqpXkdfTvXVvLpwQskiMRh\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"
  • Apples
\",\"
  • Bananas
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1076,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":100,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_c7d6978b09036961e8430bbe8403e402.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_c7d6978b09036961e8430bbe8403e402.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json index b82a4dce63..9c41a7a7f3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_c7d6978b09036961e8430bbe8403e402.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01FxUywHx19EJ8vduz1Zu7Lf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01GMjeNnqgPpztgP27iBWdHN\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

You look great today!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1036,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01GD4fNgbtX2yxfNkTBt3yPf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01B1HzBSURHdmqe1y958noGd\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

You look great today!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1039,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_1de04509d43d719c355118e54aac5695.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_1de04509d43d719c355118e54aac5695.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json index 675c284726..9f14155fe2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_1de04509d43d719c355118e54aac5695.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01BHVQz2bY4boHMqENrydnCX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Huz7QPgGHMSVmBfpodN1y8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1068,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01UYUx983MVwLLuGKRzJUYds\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_018x9BwMKvVrqr5QAsCW3QSX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1071,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":79,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_490bd381faa3237b3e0100bc2f4a41e9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json similarity index 81% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_490bd381faa3237b3e0100bc2f4a41e9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json index 4549ad187e..28da6b70b1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_490bd381faa3237b3e0100bc2f4a41e9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Uih5bW3oPXmyvpcjMaMGfm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UmCaCeQqPo2FJjb2i9QRhU\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1068,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01R6ZPAtjopupbxGs9PKQkEn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012BB8261m9mnM2jWPiZPXfC\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1071,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_306ab5e8c98c3d3fdac6887befcd68fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_306ab5e8c98c3d3fdac6887befcd68fd.json deleted file mode 100644 index 25670dfa53..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/Add heading (h1) and code block_1_306ab5e8c98c3d3fdac6887befcd68fd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-17d32bbf-6933-413a-94f1-367b37bc26c5\",\"object\":\"chat.completion\",\"created\":1758113295,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"mvbgf7jrd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language='javascript'\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.167135256,\"prompt_tokens\":851,\"prompt_time\":0.073999629,\"completion_tokens\":55,\"completion_time\":0.131192203,\"total_tokens\":906,\"total_time\":0.205191832},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5bvfttyev4bf3y63dv2x30r\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_300c17e9dfe4cc39a90237be3727f6c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_300c17e9dfe4cc39a90237be3727f6c5.json deleted file mode 100644 index 1cbd48b194..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_300c17e9dfe4cc39a90237be3727f6c5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-b4ff4e36-b560-4555-b2d7-44cdac4c6c9b\",\"object\":\"chat.completion.chunk\",\"created\":1758113943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bw3kh0fp7vfxntwzzv3vde\"}}\n\ndata: {\"id\":\"chatcmpl-b4ff4e36-b560-4555-b2d7-44cdac4c6c9b\",\"object\":\"chat.completion.chunk\",\"created\":1758113943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"gxy2gwxk8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language='javascript'\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b4ff4e36-b560-4555-b2d7-44cdac4c6c9b\",\"object\":\"chat.completion.chunk\",\"created\":1758113943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bw3kh0fp7vfxntwzzv3vde\",\"usage\":{\"queue_time\":0.084243992,\"prompt_tokens\":851,\"prompt_time\":0.07049876,\"completion_tokens\":55,\"completion_time\":0.11015841,\"total_tokens\":906,\"total_time\":0.18065717}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_00c42d9142f46a774249f0ea4c83087e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_00c42d9142f46a774249f0ea4c83087e.json deleted file mode 100644 index 3804589bad..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_00c42d9142f46a774249f0ea4c83087e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_RyxX1shhJONcx8aBJwxsZADy\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LN5iwVBenT2FT\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YIioxMmjq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"63hR21VNMAxcJZh\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Vc7sMxjTSlgZgf3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"42aYrxBdH6O9zd\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jWAFXTNU1Hr3M8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pL3ZIfd4fO\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"acgYumzKtHOqh2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Yj\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"W8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gOjvWKR3LdhEvb\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lZsU2p8jsrQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mG4ADdq9QFN8Gy\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ObR1hCICojg8tS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XdHjaYPPcZqUB7\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"H2RyUfkTjjIVy\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lBXKPuXRRGd4j\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Yp\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uU\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7R\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OG\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Code\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zw2ls831kJELE4K\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a7\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d7HTEPuZeFwJp7\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"pre\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"code\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P3cSCscWhvlGfhI\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vSqefZ154G93vq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-language\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y5MPjbDXrI\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R2xTpORJRZ1RIY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"javascript\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JHbJLx8cD\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"me4cyHrJWitf9L\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"console\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pNExaeXDNfNL\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".log\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"W1dvMQKAcVCHZPF\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"('\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eGmNYZHA7iVGs8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bV7rQautbrbrT\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"');\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Rf\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pa\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T\"}\n\ndata: {\"id\":\"chatcmpl-CGlq4eQaX1rjW8PEG8PMMkSgs5dgn\",\"object\":\"chat.completion.chunk\",\"created\":1758113176,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"gpeYrrg\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_893055235ef87ad63966a8c0356f9ed2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_893055235ef87ad63966a8c0356f9ed2.json deleted file mode 100644 index 3f2e5ac43e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_893055235ef87ad63966a8c0356f9ed2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ypmR9Q4waSscXUQY2b7uQ1q4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yNVX67cDUwjQT\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bVhWyZJq5\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PeCSNqo76PuWKvH\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jhCJCJY2puTzm3I\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jW6jG5uzyRjEaJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rK3tK5T5SwlKIZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"llVlQHYA6s\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"r\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ozshiFxHqtBRkx\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Vr\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EV\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZyaboliFsqF8X3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Jf2Rr8aBGE2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HohDCyEwA11ndt\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DtbCRCQiTuK2hL\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HAd7uYHS7WKlID\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z5dJDVbWglqiy\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2XIRbojbl6J3A\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xI\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"U\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oP\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lJroyVeFl8bJRTz\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jdeIRgkBYzheOQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zm\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Sq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BOkbvIyc2Hbv0om\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rF\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yx\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p\"}\n\ndata: {\"id\":\"chatcmpl-CGlq3GFdu9PTKgBQLssle1BPmgQj2\",\"object\":\"chat.completion.chunk\",\"created\":1758113175,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"WscjC5J\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_7af724b09a7de255b40b070289b6dd5c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_7af724b09a7de255b40b070289b6dd5c.json deleted file mode 100644 index f7cd697c3c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_7af724b09a7de255b40b070289b6dd5c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1lF7mVkB2AdUiZ0zi77AacUz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wNhXVX6cSgdp1\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jBXRIPZvx\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZMZLKbIOXtM1O1u\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s0R5oKhmfmuIjxh\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"267KioOzKNHJtg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hwNFoVPIaC2SY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NZ9xZZY16bbNRL\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"U7xRh4HpBYbj1P\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M7\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hK9cSXXgP6FKVc\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A6Mv2Yju32D470\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Eh1OA3DggkzjlW\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5s\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ft\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b3RBRDL2CLGdJDX\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hbJVneslejOlOe\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"28lpVtr66C8oS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nLet94iFQ23qt\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XU\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"8G6eGDz\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json deleted file mode 100644 index a93d0e458d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rpvk8AnkHgVUacouJ9bHLYWy\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zd0cRKXqDefYd\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MdVuJmBIS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TqzUKWFnsGO6NGM\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GfPProEaj3O4ZLv\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zot9rBXZsOHhy4\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"haoGeckRRicFwF\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YvKo8A2q9N\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OMQFdviBoq11CR\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T3gRXkxIKWQffh\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WHVrzQH4wJk\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"awGgJRsx3N6tLn\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hzvvLlTVGWFeU0\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xfUr3WiKoZ1bFU\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vweOsC2lEe2mS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QxycRkGVS7nM8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ol\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jj8ZPqagr6chWUK\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JqiZEyR1vmD5K3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A0rzlYsZ8gdqY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4cEwdYwzMK0E3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nm\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ka\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K\"}\n\ndata: {\"id\":\"chatcmpl-CGlq2fvk06YmXppof2pVTIoD9vZdf\",\"object\":\"chat.completion.chunk\",\"created\":1758113174,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"eYaT2Jt\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_f162fc6430cd63574f46ab6d4fcc9276.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_f162fc6430cd63574f46ab6d4fcc9276.json deleted file mode 100644 index 30c516abea..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_f162fc6430cd63574f46ab6d4fcc9276.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_z4Eq2uuzRa3zSyLxyeRPsp6t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q2n8qrCr5BEQQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ccFlomj5D\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ETcHmpbv3O0nJbC\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"stEB5eXmJawH4qy\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gsQB7aY9LPOjUT\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rWwrqh8Pqgv5Wq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UpqLx7cHb6\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"02QerdRq6vuNcs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d6\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ru\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q7t1qqNRNUahFe\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MApfrqniDpt\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dNKKHONjWPmnOm\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Cs8jbkHRmhmJD\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"INrnrSXgDZtgid\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SuRdobUpjCXNi\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gnSwJmv0o96ZV\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kw\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wd\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LOr3k83HtLNnSsz\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2KDo8K7cRwBof8\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2BkyvoZxcSlNh\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3vWwqPKgT5eRQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ft\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3m\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M\"}\n\ndata: {\"id\":\"chatcmpl-CGlq1dKbb7HBX6DjyOjOJB5cMLAWs\",\"object\":\"chat.completion.chunk\",\"created\":1758113173,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"iijOHEe\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json new file mode 100644 index 0000000000..8b959651ec --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29aeffcc81948e54bc90ff83c09406cf2fb3776eea90\",\n \"object\": \"response\",\n \"created_at\": 1758144943,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29af6e3481948ad9956f74d29b2406cf2fb3776eea90\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 624,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 679\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json deleted file mode 100644 index 26c11f18b6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_636c346a04a30c96e2c1c249332f8c03.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0b0f6f9d11f776300068cad87ea84c819384ee783020626250\",\n \"object\": \"response\",\n \"created_at\": 1758124158,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0b0f6f9d11f776300068cad87fea108193b2292c85a67dde25\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 615,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 670\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json deleted file mode 100644 index f224a4eec4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_6b66f4e214f72bdd99d9eb9651d10e02.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0786894919d97b970068cad87c63508194855f2e8f51bd9709\",\n \"object\": \"response\",\n \"created_at\": 1758124156,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0786894919d97b970068cad87d42e0819498341051d84b2ca2\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 656\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json new file mode 100644 index 0000000000..f297c55be0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29ab68c8819497de19666ce3d2580fe23418815ede05\",\n \"object\": \"response\",\n \"created_at\": 1758144939,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29ac1efc8194b98e55dca80fd5e00fe23418815ede05\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 608,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 658\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json deleted file mode 100644 index 00d49654e0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_5153f1102c266fbdae2a57a0daf45d18.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_05afa4fce039979c0068cad8f571f08193be47a58d358eb927\",\n \"object\": \"response\",\n \"created_at\": 1758124277,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_05afa4fce039979c0068cad8f5f78481939a8ba0f9742d9adb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 576,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 604\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json new file mode 100644 index 0000000000..c1197dc97f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29b0b13c81948c3348fdcd1dc43908216564ab3df493\",\n \"object\": \"response\",\n \"created_at\": 1758144944,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b1bb9c8194a0767590e8618e8308216564ab3df493\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 578,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 606\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json deleted file mode 100644 index 28b875d6cc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_6678671a89d2b0dae56494e1a0c5dca7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_02356bbc5cbf57450068cad87a9b98819087e1ea247c177e95\",\n \"object\": \"response\",\n \"created_at\": 1758124154,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_02356bbc5cbf57450068cad87b3ee88190a79020a0491aac03\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 638\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json new file mode 100644 index 0000000000..6ea7c5223c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29a9cb148197a48a2281e363a27c01c7ce689ddd2f40\",\n \"object\": \"response\",\n \"created_at\": 1758144937,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29aa873c8197a99b77ea9da8333601c7ce689ddd2f40\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 640\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json deleted file mode 100644 index 3b46e207b4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7c24b8f8171deedb5438290ebfa67ae1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_03e70b74837a15bb0068cad87911b881969b750928a1bf54ff\",\n \"object\": \"response\",\n \"created_at\": 1758124153,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03e70b74837a15bb0068cad879a2c08196b27a724c88f957cb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 604,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 638\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json new file mode 100644 index 0000000000..5484bc6b91 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29a81490819780867fe7f7528d9104baaf1b18b7b3d3\",\n \"object\": \"response\",\n \"created_at\": 1758144936,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29a89e8c8197b1acd75feb0b898604baaf1b18b7b3d3\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 640\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json new file mode 100644 index 0000000000..6ab0bf804d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ao9fjKE74idUq2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"YFEfiq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"h20PwbdOT4got\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qTNS2FCnbXyIvJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ysM0gSxD4qr7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CBvhOTqhumy3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"s4O6yrgugSKOt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yU78cgCagfJpC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"Zl9j0S2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"xkDbKO8Z250aC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PNwzA00896RXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"I4Ambu22OnyyP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"HPdUag1qDpZpinX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"uT521vRWkNSCi7E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cuEdc0iOMgm4c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"nvHSlTRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XJDh3M5zewwDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"TUZhCjfEMTR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u2mKFBos3u0bz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6ESN41WyvY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"FkmYRuELCdHX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uBGHlh1ROkuzpnS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"Z9NKw8vySdHjOuE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KVLyFriInufK09o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MQUKJHIpjJ8bidj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"JznnR9sSqiF0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"6pjmJ8gy6SE7Y0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"b2DYauBOl4yry\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uhA2O81dpShikyn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"UJcTXQGbOYNCk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"nwKPnaTogU4oDg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"ksC38gSGv1yk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"K1njiBTTXoZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"ls17qbd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Cprq8BGoETeja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"44MYJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"3xR9Gd4uu22mK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"nO5U1swol\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"EWZkJP55Hf5d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"0yFMXUqKkY4nK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"2lh4CDkz7CD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"OeekOWcN5B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"5FMgjL0Sy6RS8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"md1iNW2GNVuU2C9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"OOwHd12yXDWcyy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"KxTXtHuEAJ5BB0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"PKVtCJt8R4Xjwy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":624,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":679},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json deleted file mode 100644 index 98ce0cbfb8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_99059264437bec6dfb23fc667f1faf5e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MDghQLOa9Ef8SP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"J1iiqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Oau4B6JxEmVm0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XREOsNieeKVkzc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"h8MM5Oh6LEPK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JssG2JJU2UlIa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"ZcwTDZc5e6UfE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"tSSdZK6HM5eT5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"hwVjSmk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"K4XPzTu96fXi02\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XmSsVF7pI3QTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"NNR0zmu1eORse\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"nquAGq1IogLIiv7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"4DvFvBL2cjNAze2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ZjXw1QhA95889\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"eo3WSmVh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3mRNy9yCTPicK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"L56VhH0OxAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AEbduk6sHDUyS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"OBGVUo1KrO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7GeJqX2i3Vf5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1c71zVxXN3IAmJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"JQ8jamxqyMlpGSL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"731Stwmi2fv8mk6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MOElv7R4zeEzDzp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"WhGcwZFC5nzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"EHJzQ3ULriaCQm6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3irrttjGgaiWy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GXA8gSdHFkp2evx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"fdKa52102wG3A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"zGUgKGK8EPJR14\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"WmACDVCYI06D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ikydh8xgfsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"arM8L3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"88ZnIMtUixtIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"tkK3jh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IPyR2ShYIP1KE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"vDvpVzObl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"FaxuyNjSFf5T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"RIa66xTh0AYn5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"P1sg2RnMojI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"enArkAynNp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"dB1juS8NGtpST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"xjq67P0iMfCUmvM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"0cAUhR188iuO48\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"2b8uwe23vBn9BAg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"oatgS1FzJK0DP2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_0101ac966962d6c40068cad55be03481969fa2f98a14bdc4bc\",\"object\":\"response\",\"created_at\":1758123355,\"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_0101ac966962d6c40068cad55c652c819684176b1e609e52f8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

Code

\\\",\\\"
console.log('hello world');
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":615,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":670},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json new file mode 100644 index 0000000000..4d9da3f35c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Duau6an9JmCwhn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1rmO2a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZZHLEv76Mig6C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YuszvzBLIrYhiL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"C5Vt7W9EEybW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"q22v6w286mr19\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"D6Ez13YYR9BNH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qLAHNhpdf1j9d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"hRkvym7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ZPhydmySHdEYpk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PmhwQ1D0hKFUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9PvDubjwkgLui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"CrrBybYGE7zv3jQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nL6kA2d77e1TO99\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3pMy0waF9kkoH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"TYdowxvw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w09pytTCFQAKI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"LEywhFebAqR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"l8AJRnH5DUQjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"N2Zi1rudnl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"t8JqbBk7KKzN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QLWl1fJoZ1J12CB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"oNfxNZguKNVpl5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"O1yXeidPABGGRS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"UrXVx7gBSCtcCa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0j0Kx9AbsfFUaKg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"hf18hcWmCJI6oW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"PY6HjCrPI0cr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"CLuejcxKVnKAKDo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SyTUDxirKE08U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"mATXu7onQIXuW4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"k0jp31wBszkxAv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"vexwPTszU0GYFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"TUdtrBl4qqekt8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"1AGembRFYVkWuUz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"oRoUNOD3TqGsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"mXBmHmp5emN6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2eeKRq0qI0oH0Xc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"tidmDo146DWBuw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"zVsRjBSvCcfJ88p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"dS3tdEO43MJldh\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":608,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":658},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json deleted file mode 100644 index 26c1679f44..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ba651e401645ce4adc5ee557436f8b23.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"pGSpIjmviLBbog\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"aB0Smy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"olmgl8K3rrmgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CYGiOG9nppE6nh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BNaAuCMcSypj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Q2YjLgHSSSqF1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"pcHAlHIGDmpKC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SYoYEqWG34qk8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"uuRUZcc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Yd5PVcr0RN3gKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0AK38qIWEhpaN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sZ4eZxTFbVabh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"2FyXuJVYE5ReGlE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"05ZqmtXqCRg6xHm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VFeoZuUtED8i6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"tJSgNxE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fkrJ8nQojTMTH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"ZDNrnbeo01H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sSCNVQKezUbl2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"h6wAHDMEQh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"EOzhxQGs1BL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1ILxO6Cta7K5LAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"4bFza4zqyp34zI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"uDAMg75IEPzcop\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"ay6RB5ZJLaoTGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"KnOcPVzzOzey8cR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"OSnWnyKN0jKJX2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"qrAp0J9uJ5R4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"I7BXuLmlDufF7mY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lIPCUW3K4hQoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3T3BsihYr8XqQgf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"fJltwcfIwQqHuy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Z0dpCOS82PyzjB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"nVdBPGKgN8Vm08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MKyWbFTg1lDnm2B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"bDweWwUmHwdj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"8eEEfIgNTEFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"PoHf5G3UM7rpD7S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"dyKd6MMpGUfQ2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"uTqbrkcGZlqMtLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GJWEzlaVd1DRso\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_0c9e548addfd61bf0068cad55a0fbc81968de69f04a4b614f0\",\"object\":\"response\",\"created_at\":1758123354,\"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_0c9e548addfd61bf0068cad55ae06481968c3f50340ce417b8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
  • Apples
\\\",\\\"
  • Bananas
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":656},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json new file mode 100644 index 0000000000..c99aa8acd7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cjuGNSp3ytCqoG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"uUrPmo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CVlLlEpfSirCY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"anZxtNGUzqXvkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Cu976WYOYwVs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"26fTgYbySgEoi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"TfVYbI1C6k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Aean7QiqycPd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UNzYhSQlsd6WRy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yBOv3Qy04za97\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"c3zsZo6crD3Xu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"dtDqPWHLWijtkEc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"grWwBcNTTVDdU6F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HZFGxS7mM8Ffh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"1DPcoEAxhyE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8RAOG0BqGO7zw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"TsUrx559ktQkoSi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ZKVsDVwLdwj0YRK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"Ddzno27piG13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"Icy0BPVRCjj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"bKbIJT5yq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xcTdGWTkCB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0kL1mwM2tqSn5gq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ydc1SOonllXfRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ckAsfLEkYDZ2dk\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":578,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":606},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json deleted file mode 100644 index 6af1ffe0dd..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_d8a4e627865c7b4e0acf05a0dbb44be4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fMbLkWH8JD5cge\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zA5IQx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"47lmx14CyAzrk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"KQu3PvQtcT2gIL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tXo6ydgEZQmK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"42fcJkXmJGQfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QWe1vx3ase\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TTMzN2lnXabS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"NFReYP1vKCNiWg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SBhqBe3upVLK8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"2SUtXFVIEkA0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"UauHhOyouRzivBV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UqLub97x2LHWCmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hzCaOneyMUk1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"rulGApQtpce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZMU6kxqQ6C1gj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hUmIWWGLmUFDoN3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LrgLC8bJVqHpRha\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"xkSCtvqUxOgH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"KXZzW6Yl5WY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"vSpfEAJFhe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"HtVy4gk5mo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"BinnFLZyj1RkGlV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ZNzqOdqPFg17J8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ftrgiQljiCK2zz\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_0c18b07f6c17fc3d0068cad852b2c081948a7e4fb2a2ab26b2\",\"object\":\"response\",\"created_at\":1758124114,\"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_0c18b07f6c17fc3d0068cad8546ee4819488be916ca0ce4232\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

You look great today!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":604},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json deleted file mode 100644 index 9b78f6162f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_80827ea13dd89bfa4e496b3c1a26e6fd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fPzwEycA8B6SEL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"fc87TL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3E4pkFFA3bGOB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"48ZL2nP4Ibqd0i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pUANsD3t0rIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HRacXBchoPMG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"EY714ZimREzme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6r5IjSGzqZubk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DhS3dpP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"EsfAkj8jJcr03l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ND2dwy1oGy3yI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"MHo1gVjSwGsFR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"4uHUe3g4O9CgLxM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QL5sQDODWfLi64c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qusbkooSplxkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"igpt6uuN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fJsJpXX73ajbU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"6WnwTg9OBMM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ceoG9Kz6SW5jd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"UINUfurR1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"bUbRaVZW7C1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"9Y8JeMnn4G0N9Ay\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gmjfQoU1jAwUYuD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"IlX38XWDPLyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"rTIhUy7UqiD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"S4JkrJaIS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"DmkcSb3HgH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3qGHWRJKFkCvDyz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"7QqJsJggN1Qbzt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"zaTzsZjHOKggfDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"9QvJEhVc5Y6vpl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_0d75d0b5dff1c5b60068cad558a1288194835c0cb019eb7b35\",\"object\":\"response\",\"created_at\":1758123352,\"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_0d75d0b5dff1c5b60068cad55923408194887ddbab75f603da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":638},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json new file mode 100644 index 0000000000..3faa3a4361 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OfIG6yYPUvIjUw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0D75Tr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"aizEDN4KqCI4r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rZiIVYQHkpliFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"s0e4itYimxUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B0aA7Q0waXtws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"p3UpA8YNkozPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bEiUCtmwobPEm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"dSQOJPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"noXtgsdaD2fFbU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NDJG8teUcj38R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yWEFy1MTZf7bC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"cYxMnb9QxUQjKLl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"iwuIP8Y2OjiWVzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SGC8tdzg7ly1F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"PvTpIutb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l2XsecAephEHO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"OUpfGoIKz3k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"g60hbZBCSqBZd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"m2KaKJzmEZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"BWF3mmDwc5n6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rP8wIlkLEjeQb2f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"DGR6Z4YhHVtNT9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"1HJdu6xtIuDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"dup2keI4aqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"TrmBarGQ7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"rUqYGtIbpj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xatNrBEgNXoPNee\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2hec8Jdfuhl3vy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"62OY0oGQS7NHSlr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"de9QEFpeRNsUfU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":640},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json new file mode 100644 index 0000000000..59fa1e7d55 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"kr4Sihq7PEoivl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DVOrdc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Uvpa5yqXeEfUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uODfdziEooT99L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"aQn84vN2YqAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EwBxlHjicNff5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"BVoZZxqbs0UJe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6QyYAns3lpXo7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"WztLWAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"qWIr8Z7BbncgSw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qrnHSNGJizVaH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"PXKTqtQzenDRZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"FYzL4LhIu8WuW2t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OrSAmOca7KXOujb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AFNXuJFg3DwAI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"3fWEVbk2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uBau2DjfeFOEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"uxA1Thmg9y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dkgq8OucQgB4D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"cEwBShvE44\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"BJMJRH4UBzoe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GOtRBGv5xw95HNL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"o98SzGmGvlwYgfd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"JCOvrVHFVT0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"gL4TEYW6lqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"vCB3SIswwz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"3thhKT61TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Slepv8qSWSu9BK2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"VPx6QXaNC0g669\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"8P1VAN1lJRz0Ofe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GY8FTK8xDSeENv\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":640},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json deleted file mode 100644 index 1e482944ca..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_ccaa26a39b8dce298abdf194e096f42d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

How are you?

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"F3OxvkjMoOvWXO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"jAmDLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"GcNccPnprePhc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FF1wYFBrtlWooC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"MuB7YUtwIE1X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o7OHAUhHNV9p7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"t3j1WJOgFTF2W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NaPE3KKOWwBAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"oq8VZOF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Y0H4gEmPCnLtVk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x6llO2MXlfdts\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"NKLrz8NWKouw2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Yw6KBZ4m3zfbEhq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"1qvLjf2cF6S3D8h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"m8NNbQ0JeK9la\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"zCrzEc1M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"haeu42BIAJi1w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"Pe5PndEFTj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"d5VWQNhQFT0xl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6Ylbrq5FiK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"TN3O4VeN1PRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AKL1JqaAgnudIrL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bf1wEfYGiXELUVh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"QQo931nIs45K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"EWjeSHWf2PG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ucmSbr3N5g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"rsKzKzTB3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"aUm1UZRPUhQDGQu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"CuOFhoD8PgMZPG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"i1oAIkoKDt4diw6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"yxQM3H2xPn3vkR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_01a44271b499203a0068cad556f08481939a256b94eb2918eb\",\"object\":\"response\",\"created_at\":1758123351,\"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_01a44271b499203a0068cad557b82081939058c5167db0a3f0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":604,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":638},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_0e188d2a921d6dac6d6e40274fb58e46.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_0e188d2a921d6dac6d6e40274fb58e46.json deleted file mode 100644 index b8c6fa3d43..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_0e188d2a921d6dac6d6e40274fb58e46.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_014MypV64AA3UEdKdpCs8ufa\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DxJTVZ966ncbyGyr52M1ii\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1278,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":127,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json deleted file mode 100644 index d212005284..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_41ff47b4fca8d8385d05699430391371.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Nw7o5pKqFdUjR1nxSNZcKd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01WzDyHn2iWzgEsejQK26zBx\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1194,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":118,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json new file mode 100644 index 0000000000..a2de3fa6e9 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01H7rc5DxdNA7b61Dqiy4B2k\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01VgkpCzApsSiy5Tfaw9ztDc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, wereld!

\"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1226,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":118,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json deleted file mode 100644 index 231d1d35a2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_39cf1461b71867689c0f440d8bd07a16.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QndZovFbNoWL6mRUfLNdNZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019CMoWBZDwf8i8iv4taHm52\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1013,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_5f7ae491c3449ea3417bff42c10f4c5f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_5f7ae491c3449ea3417bff42c10f4c5f.json deleted file mode 100644 index 1f0b1505af..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_5f7ae491c3449ea3417bff42c10f4c5f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_016tQrVgHPBdykq8x2Z38xJM\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01XTrgtEE2QiUKfhNA6aPHed\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":124,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json new file mode 100644 index 0000000000..166b44ebd3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01Fmz6ue7V3xdvGoZAUYWZnc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TjjJnBPLTS4mPkomX98C9m\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"},{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

You look great today!

\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1044,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_2d61c5a123cae75fe48d74bf26f033a3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_2d61c5a123cae75fe48d74bf26f033a3.json deleted file mode 100644 index 7101dfa824..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add and update paragraph_1_2d61c5a123cae75fe48d74bf26f033a3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-e4c2ad66-4118-4c6a-97ff-3baa29a7ecc0\",\"object\":\"chat.completion\",\"created\":1758113816,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"15vvkzmfz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.0856286,\"prompt_tokens\":965,\"prompt_time\":0.080391904,\"completion_tokens\":57,\"completion_time\":0.137163516,\"total_tokens\":1022,\"total_time\":0.21755542},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5bvzqaefc88108s727xjk7m\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_e1aca3374c81381183ce604542843900.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_e1aca3374c81381183ce604542843900.json deleted file mode 100644 index b436689256..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add paragraph and update selection_1_e1aca3374c81381183ce604542843900.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-0d87815e-b87d-4411-bc40-02c1be39d05e\",\"object\":\"chat.completion\",\"created\":1758112755,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"xw7gz1b3w\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.086279527,\"prompt_tokens\":801,\"prompt_time\":0.074983742,\"completion_tokens\":55,\"completion_time\":0.148529768,\"total_tokens\":856,\"total_time\":0.22351351},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzbtvfsybhsbc55nw8ah6\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_607d4d9f46629e45f3851adc6d41d4c2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_607d4d9f46629e45f3851adc6d41d4c2.json deleted file mode 100644 index 573dcfc936..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_607d4d9f46629e45f3851adc6d41d4c2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-e99b7280-0a53-4104-8d0d-09f76e7735d6\",\"object\":\"chat.completion.chunk\",\"created\":1758113815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bvzpbvfc6snw95qf5rarpg\"}}\n\ndata: {\"id\":\"chatcmpl-e99b7280-0a53-4104-8d0d-09f76e7735d6\",\"object\":\"chat.completion.chunk\",\"created\":1758113815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"vd67f7mr5\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e99b7280-0a53-4104-8d0d-09f76e7735d6\",\"object\":\"chat.completion.chunk\",\"created\":1758113815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bvzpbvfc6snw95qf5rarpg\",\"usage\":{\"queue_time\":0.087961168,\"prompt_tokens\":965,\"prompt_time\":0.085302247,\"completion_tokens\":57,\"completion_time\":0.127883537,\"total_tokens\":1022,\"total_time\":0.213185784}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_8d3b49c53bee6f8c6b3ec838d43e9443.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_8d3b49c53bee6f8c6b3ec838d43e9443.json deleted file mode 100644 index 491a58f5e4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_8d3b49c53bee6f8c6b3ec838d43e9443.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-489b9691-afea-4d56-bfc3-72437f654108\",\"object\":\"chat.completion.chunk\",\"created\":1758112741,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btyxyhe20r039crbwww915\"}}\n\ndata: {\"id\":\"chatcmpl-489b9691-afea-4d56-bfc3-72437f654108\",\"object\":\"chat.completion.chunk\",\"created\":1758112741,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"m8xc1p2jv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-489b9691-afea-4d56-bfc3-72437f654108\",\"object\":\"chat.completion.chunk\",\"created\":1758112741,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btyxyhe20r039crbwww915\",\"usage\":{\"queue_time\":0.197639147,\"prompt_tokens\":801,\"prompt_time\":0.068377936,\"completion_tokens\":55,\"completion_time\":0.147255571,\"total_tokens\":856,\"total_time\":0.215633507}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_01e68b70cd8cdf6436f9b06f75ac269d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_01e68b70cd8cdf6436f9b06f75ac269d.json deleted file mode 100644 index c844efa5c3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_01e68b70cd8cdf6436f9b06f75ac269d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpGlJLn5d57ZOeXngeqq5p9rr49\",\n \"object\": \"chat.completion\",\n \"created\": 1758113126,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_BwIWTgHqtpgOpPjihlC1mgSG\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 691,\n \"completion_tokens\": 55,\n \"total_tokens\": 746,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_96437051f6bbcb1c7a6e75501a1c3693.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_96437051f6bbcb1c7a6e75501a1c3693.json deleted file mode 100644 index 8b210a2841..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_96437051f6bbcb1c7a6e75501a1c3693.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpGr9ESdCqqMSxkIfQ8mfp4MAyR\",\n \"object\": \"chat.completion\",\n \"created\": 1758113126,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_yLQb6Le0o4mRM5ZYZYlbxJc6\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 531,\n \"completion_tokens\": 53,\n \"total_tokens\": 584,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_4b4bc6bf80353f21d3b81a63e9f3ef54.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_4b4bc6bf80353f21d3b81a63e9f3ef54.json deleted file mode 100644 index b6e051bcd3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_4b4bc6bf80353f21d3b81a63e9f3ef54.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_z2vRCvUYqH0XZ3taSZHy5QfH\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MNWLpm8j2eOh1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XfN1bf1Ja\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PuQBSaDtoLfVazs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"W3y5js2GQKVRiaU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GMUjMRk6XIaOmT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xQISOvuDAZHoa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cqiU7qPJaPBc4l\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XuNe2SeOncuJ8B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"J4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"D8tOglbTOvPFjo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3xnCYLxCKpnWhT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SqE9ZrTyHBsk21\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9V\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I3syl9zgJ5BlpA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" wereld\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iLl8185LUyXB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bzQiHI5d1Qzgpe\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TNrdq5oykyIQbd1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wp5NEckDZDbkTN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RGnSeL20es3pZB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nUjjkT3yjZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cM5cGhNYjnyMMS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"so\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ksyPJnGcogHycS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yuaZXOroWqZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M8QSsiZcjiR8Ee\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PXebkWyBY9IWqZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Hk4CdomznLVwam\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SpI7WFAJUO7Lz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l7xy5xVFT5VVh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rQMbZ8K4A5GIGbP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vgAHEsiT15n6OZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4PDlWHZ4TW2cH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"djA1oBlIOXQZR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPeSyz5RShZQnXac9Ee1Twr1Ub\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"6iFgPhj\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_40c00fd5cd485b1554b63a856d0ca2b3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_40c00fd5cd485b1554b63a856d0ca2b3.json deleted file mode 100644 index 44ed79621e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_40c00fd5cd485b1554b63a856d0ca2b3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ET5TuOgukxfFgRQ6HDgt2vVZ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XKgHK1KyPghsX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XEhFyLpva\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OHSP2FiKQedzWQG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xko2m84oQOuZWvU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BiC3hkd8QcgxTb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aLl9h1fVyzqju6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TOqd3GIQNv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"L3KRZjH6dDnoYw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9WS4X5fuUmlK18\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5XQLRGTQ3Uo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"62zIxwQXS8we3C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8fbEWINiWFyw9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JxkK0rpULuvnOk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WJX5Lp5in8Dtk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3ybNcvF4ChLdl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B2CtbK2g4FQcxKT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DdNJqLrqC2nuVn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qrJT2qmwnP3X9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Yzetkr061uow4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q0u0FuTpm4VPMj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CmO0dqMWWUQKbn4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jmBqpSJsQJ94a3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"utJSBMNI1LYmc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MOFNypr41g35WJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Eqg4Qsdf02Gp49\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RheID7MhselPUX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e5nKe1WIYC371D\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1gq0PGyI2BV6BS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"79\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"na\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VVSHsyFIu55O3A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p\"}\n\ndata: {\"id\":\"chatcmpl-CGlqRi5utgXzqUQwOvt6AwCx4bJf1\",\"object\":\"chat.completion.chunk\",\"created\":1758113199,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"80RQUe3\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json new file mode 100644 index 0000000000..36120cce75 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29d44b988190bb2162488df224ae0cb9603cfa40e653\",\n \"object\": \"response\",\n \"created_at\": 1758144980,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d4f23c8190abb5d7648be2619b0cb9603cfa40e653\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 738,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 794\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json deleted file mode 100644 index e85a3d7460..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_851b7242fd29b343abb0a86c005bb650.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0f62143fdbd77bce0068caddee0b5c8193981f12dfaabee590\",\n \"object\": \"response\",\n \"created_at\": 1758125550,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0f62143fdbd77bce0068caddeed32c8193874c4dae746665f1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 709,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 765\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json new file mode 100644 index 0000000000..e94c587dfe --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29d60754819786aba99f18301f500d2e6dcd281ab8a9\",\n \"object\": \"response\",\n \"created_at\": 1758144982,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d7ede88197bef55cb27ad4ead70d2e6dcd281ab8a9\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 571,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 625\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json deleted file mode 100644 index 592af1e5ac..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_9a144ecbde0b871de374e8ca0e3fa323.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0a5e47995f5782a40068cad8a8eea88193be23419023cfdee6\",\n \"object\": \"response\",\n \"created_at\": 1758124201,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0a5e47995f5782a40068cad8aa1f8c81938c04261aa1740a17\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 543,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 597\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json new file mode 100644 index 0000000000..7045c378ba --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"05Nh0RAQfjzl2I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"d7WTvh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"QzHzIB10liZb2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"s25Nl16Dm1sm7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"MKvLTuDAxk3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Gfj4vrZh1V0jW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"af6Tyub3iN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iH35CRtWBsn7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"X0glbBSV9EcKhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3LrnKwMyna7iN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Trh3xz43e1F3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"bo2cwMcnAVe4vlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8vqvHZkICb3POdM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"kTAn9XbGvaUMz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Xy2voCXmfNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jchJzOyJiiUVY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ZQuQsU6H9BbnmOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xUiHuqt67QkdjAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eUsOPwiwgIhGos5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"0a0OKu827Kb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"DghyZ2jpveo3J0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"V8JthzkB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"LvARIzb6TfhaEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"4OLyNlpaikSA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"8px1eIobbrEo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fE8qRjJdaVrL5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"GIAyReE76twFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fcaesSu96hbtT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"UcsY3vT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"nyh0QWqU2UwV3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZFU8aY0lVXE6a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"CIkp4MKs28l5m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KiQ2DkWmztrfe0z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"U4e39tcq9IXMOmn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hwadJcMGMPdD8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"al5gKwJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zKUOh0hDg7j9U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"LeFv0OCG1xv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u8UftDYS6ZG05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ftwu9Bp6Je\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"mKEvBJ4aLhx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kVVRosyrItt1j6Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tDhpcPPuZSe6AI3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"QRGuNLgrz7Qv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"LKY2lNEz6TR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"TcrhpPr8sq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xrGf0q71MF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"YY7M9O6AfseavUP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"nk3KNGR2t8jsh0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"QopwVz74HhqON1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"anD7CwtAZwjed2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":738,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":794},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json deleted file mode 100644 index f3705fb7fa..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_c684f68b8f8b674dba89187794598da7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate 'Hello, world' to dutch\"}]}],\"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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5b1K4AO42WRnIt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0UdyMz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"tzj8d3IQjsuYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"H3cb2RUdw1BEOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UeXigCXkGkWm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0vfWoScJxh7qA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CxRHSQSRIn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WuDaA3od2Uflv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Ar1cN4JypXIx55\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JzTXfcZWBMcKh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Wj2slocjtFW9Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WOFoEG5nPYMDm6p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"XtXtNt1xyY6RwsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yPk7ac1xzMDBr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"otZxFOXmHYl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EyeTSng8vMYOJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"s0TmIsnIgk4eaUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yv4ZI1TNXAUhKlg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"sDcsyqhxRB4vPIC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"zQ2fFSLkSCy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QVDge2VBBNN2E7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"QOStoIyrn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"l4iCOipvh7A4Kx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"TE0FakS3yCYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"SBAe0QPBYF0n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"g0rxwaEzik78b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"qNsKyKBUHJYIy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"f6TX4F9zn2ad5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"WsXoMK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"jB6WctFI3osQhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cFQHLslTNMkCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ce1SBNv0JjH0H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"tTnEA5hTDTM8upo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"9TTBaH9KDP71MSk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"CUqEsu46MGqLz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"2IPcR8Q6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vtdaKUgm7o3zp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"OFn7RuCWYfS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2s6dN1FwcFx3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"xlGYtNASoz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7N7ZzFRSLGrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PvvCw26tw2H415D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SjqZ4ymTIgNhn77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"dsmkLFjH1Qn3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"RFTZrtpchvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"EulgmQb36Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"7DOp7I1RZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xraml93e1ueCdXf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2aWHHwSWqCiCXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"0aHpLxHfhGtAVsS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"DNqRBazAfX6Is9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_038e0069f2eb15fc0068cad8738f548190bd9a449b761bdad4\",\"object\":\"response\",\"created_at\":1758124147,\"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_038e0069f2eb15fc0068cad87416788190ac9e844af8cb3535\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, wereld!

\\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":709,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":765},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_837eb32ef792caa67d1aaa4f9b7d7b91.json b/packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json deleted file mode 100644 index b92a3342a3..0000000000 --- a/packages/xl-ai/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_837eb32ef792caa67d1aaa4f9b7d7b91.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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 HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QdAI1iUuCbk8sn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"4E82fp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Z2CYSgNlUqDfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ktbTzB1EsAzutq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0Nc73JjL2doH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7NZv1Ig2QLexh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"NeMZbnzuUIfyZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"n9yW6nlLDRNIk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"soYDDU1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"o1fK7L1QWjY6Cp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fXu6BnEmbTqPr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yBuZZyyia2z2O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"pBF1wHyqoIvLzfw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"wxtcMm5oLavyrqt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QNT2a3bb9R1GR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"wFWPJMXE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2jhaHtaJiOqeF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"cmHqpBDufr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"btnE2npz8TVlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"p3tUuGKO1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"IhN1bdaKzy45\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"JjmZOrwg69TGStM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"BIOmy6pjQOJRF40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"36vYJVbBMq7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"KYqDVbPplaA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"gZK4cmnIkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"YXLogjcjIE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"81Fhh3OJL1wD5bg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"04I6xAE1q861Rt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"xN3WqYHXL7ea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"CHP2lhXsHLsy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"F97wt8UCNSAVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"KnbDX6YubI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2wtgEc3cVU2LI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"P6C5B0M79Dk88D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5EhPpAKU1TU3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Zw9uOvsr7ws4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"M8XFAXvgcPhXTjc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"63uJya1xgMT6vME\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iT1hRcDhVUFkH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qYusuOY22kC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fpklYNwriN0Up\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VA0rpEnXVhHzf6e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"kpKdTBB52VzVL26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"basfOdfIdYXSInc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"dJ56lkZSxpS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"pFLqp8u3FGyG0or\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"JI8EhyO7kq5ZKM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JZ62bTb2xki9H3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_0aff57a322bcbaa30068cad87534a08193af67bf064c13dade\",\"object\":\"response\",\"created_at\":1758124149,\"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_0aff57a322bcbaa30068cad876031081939c4505edf4df6bbf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":543,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":597},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_c6fb82e817b9dad69fb7d7369cac5784.json b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json new file mode 100644 index 0000000000..8f02ad3aa2 --- /dev/null +++ b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"riEVgB9ScbPjm1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DkxmAZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Eu5QL5xEueySw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UrH05StptHtRRd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"v13tOreQmFlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MfKxicA0DIKZq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"B5FcqZ2Ijc1tZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9uHi1cI5H2uhX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"pTLxC2A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"mLhPNRje3guEH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zjI0ggUOTyYjj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qpYF4k6cZ9Hlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"elBBkDVXcQbvBcs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8fYWyoyHgq2gbCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gQzPTBZWH22Hp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"Ehvee8BR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"n36O3DnidI5ad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"QKRaeKiEsU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"W82oHeyrZrzL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"jgZvC86I3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"xTX9QJycRL7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wopOR19jmBNl4UP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"X56J2jnoYLrR1ye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ota68F8D40QG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"WkI7tsCDGxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"lqMOWvD02x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"ZFjvAk88Xc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"aVqFNLurHC8aw41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"QXoMUHi6U0xour\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"us0jh8cnydqt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UqDqcVwx5UhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BVR5MmYUoOG22\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"iNi8kdEfGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TuW4U37o3sa61\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mEYEm7kNOhsfGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mdYFHsKyHPk9p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"YQOe4vm9Xq4zC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"k8V37j95P38Kh3o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pSZUnlxOneCZ1Vk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oUaCt1elhcYov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"T6VJLld5bcb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mpZfK2GjBIS6s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hIzznXV6AUSPOTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dSk9R7q2SpXAc9E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nnfThzB9R43cVex\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"vj372ULjs7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"RvW2tsXX6i7weBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"3cigmmGJ186xlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"eizrT0CoGu3KWK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

You look great today!

\\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json new file mode 100644 index 0000000000..f2567c43c0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01WncjAqjV2CzQ9TcrjD1cYU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013fZYkd7j9T9nmn1ykZdjrj\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1201,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json deleted file mode 100644 index 61cbe74052..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_80e6e86a31a71d50adeb8404f21c8dfa.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01CYMseRP8sPeMmq8dPsoYez\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01S6332VwjaYcRYJ3FDYmR7r\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1170,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_be4abe78f0900318e7f02b64cd567b48.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_be4abe78f0900318e7f02b64cd567b48.json deleted file mode 100644 index fa4d244f71..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_be4abe78f0900318e7f02b64cd567b48.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_017vcWmtoXzQLNfJAjNqfBUd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01AhD9kWHyGSfx8AusV8F7jM\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":59,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_12e70268f615c2e6a251a0c822f5c852.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_12e70268f615c2e6a251a0c822f5c852.json deleted file mode 100644 index 367db48b07..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/delete first block_1_12e70268f615c2e6a251a0c822f5c852.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-1753eaba-0656-424e-b8b8-f53c84d59d13\",\"object\":\"chat.completion\",\"created\":1758112761,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"5q6ys1112\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.168821934,\"prompt_tokens\":941,\"prompt_time\":0.078542993,\"completion_tokens\":21,\"completion_time\":0.071934183,\"total_tokens\":962,\"total_time\":0.150477176},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btzhseft7v4ey86tf0hmja\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_af6efe0bca3582e6c8ff21ffc13eba7b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_af6efe0bca3582e6c8ff21ffc13eba7b.json deleted file mode 100644 index c2ed3e092e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_af6efe0bca3582e6c8ff21ffc13eba7b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-024f514d-2be4-4d78-bcf6-3454200420ae\",\"object\":\"chat.completion.chunk\",\"created\":1758112740,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btyx1qfscbkce8wdd3d0nm\"}}\n\ndata: {\"id\":\"chatcmpl-024f514d-2be4-4d78-bcf6-3454200420ae\",\"object\":\"chat.completion.chunk\",\"created\":1758112740,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z6sqatvvk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-024f514d-2be4-4d78-bcf6-3454200420ae\",\"object\":\"chat.completion.chunk\",\"created\":1758112740,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btyx1qfscbkce8wdd3d0nm\",\"usage\":{\"queue_time\":0.168645615,\"prompt_tokens\":941,\"prompt_time\":0.078465035,\"completion_tokens\":21,\"completion_time\":0.071091781,\"total_tokens\":962,\"total_time\":0.149556816}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_732c937802aaa089d01c37b91dcac697.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_732c937802aaa089d01c37b91dcac697.json deleted file mode 100644 index eebe8157ef..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_732c937802aaa089d01c37b91dcac697.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpFQ0ZCqS7sZyzTbWQ84r36p1ya\",\n \"object\": \"chat.completion\",\n \"created\": 1758113125,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_SkWeb6zwgXAOqtfBkKjuFVgF\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 667,\n \"completion_tokens\": 15,\n \"total_tokens\": 682,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_30efafef9e27f70713ac6d216c71f723.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_30efafef9e27f70713ac6d216c71f723.json deleted file mode 100644 index 00b9ba60df..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/delete first block_1_30efafef9e27f70713ac6d216c71f723.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_0XMQ4hy9dHOOPaKTuFlTgz86\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KxWegRjfMTIB1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XgYY0Zzv8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F1UYzXlAAepkVuU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8pInlvWT8MwlfxT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1vfp0ai6vT7Lli\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SdVickxjLgIhN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iTn7dIVlwkXUbf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rQuGU1YF73o0d7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqPtdHboySZWUNYM4JamVR3KvSf\",\"object\":\"chat.completion.chunk\",\"created\":1758113197,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"0BdxpH4\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json deleted file mode 100644 index 9f47be22e5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_43b215e15138f6f142a80fd451a58b29.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_03a50c2aefe1a00d0068cad8a4903c8195a5e44900b915a100\",\n \"object\": \"response\",\n \"created_at\": 1758124196,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03a50c2aefe1a00d0068cad8a507508195b2aab7aa8ed00dda\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 686,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 702\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json new file mode 100644 index 0000000000..0b8d0fd1ed --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29d3302081958deb34668efb59b9051fef0706c6e057\",\n \"object\": \"response\",\n \"created_at\": 1758144979,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d3b62481958195bd2246f38814051fef0706c6e057\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 714,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 730\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json deleted file mode 100644 index 7f3ef73bde..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1cd1e0ebf217dc48b3b49ec536911be8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MVdbKRrO4swuHQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cW3NDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PN7AtNhPl9hYW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"x8yWBe8g0Z70uw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"OG2boREBVIEF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0f5oxuz8lUcEf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"UfclZT9kn8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8R0MCLzKUqPgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"k10CkT5YaA2gxe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1hooRlAt8IXmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"6vUqIRGQduVXX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xytkTqoKLf0nyBx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"J6xeHByI1vCPqwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"wnGmUh0LzhROTP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"H3cuIagaDex1DL\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_0f57faae4d2d2a3c0068cad8f440708196806e5262b3b4414b\",\"object\":\"response\",\"created_at\":1758124276,\"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_0f57faae4d2d2a3c0068cad8f4cad48196b85b3451d15fa2c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":686,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":702},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json new file mode 100644 index 0000000000..fd8154da1f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0S7RNyMGPpYMEd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oVsr6o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wH5qsegPG8Tf8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zh3S7jYWiAsEwU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bVtV2cgEHtFf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N0dAdn6WVZrY9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"FKZPzEIiNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4llKpeAIluL6q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"fBpO4DsNqIHlaL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JgrPKwF1f6TLj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"W5KDkk1gRBGKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xYmiy7WmAcnhRlF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JBq2k5F4U6fo2e4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ZBzk15Q3KhrWMe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RDM7ExiWJ36KpG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":714,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":730},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/clear block formatting_1_301b672f7c4cbdd034fe74e9c3166861.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/clear block formatting_1_301b672f7c4cbdd034fe74e9c3166861.json deleted file mode 100644 index b1bdc4ebc5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/clear block formatting_1_301b672f7c4cbdd034fe74e9c3166861.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Uc5roFJc7fN11JMEozt9oW\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01VPUM5ifG4cBsg2TPGFZpbM\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Colored text

\"},{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Aligned text

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1154,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":111,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json new file mode 100644 index 0000000000..6307ece647 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01AUo2asF6DLwif8KGGHTufr\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012zHgfF3zze1iFzYk5N6VAk\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1221,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_d428f1cf0fef38221f6d7b182d72628d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_d428f1cf0fef38221f6d7b182d72628d.json deleted file mode 100644 index 0f89361403..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_d428f1cf0fef38221f6d7b182d72628d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_016J8Wu97UZz3iA6wYcGRPyg\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01NQzB4J5ZKYWEqNCnfzH3zt\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1273,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":79,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json deleted file mode 100644 index 9103f3d595..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_f6366ff3ba630d781bc34e5504b23982.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Q8BRUShduuvLr4BtMXmmuA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016kg7AnqxNzBt6Dsr4ZD92y\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hi, world! Bold the text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1190,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json new file mode 100644 index 0000000000..e5c12aee4f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01W4oY41GE7dNrHUd2kKCDQH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017rMKFgheDRpnquAourPeVw\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1214,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_db4f1c714b34a8689f89cf2ea74dd9b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_db4f1c714b34a8689f89cf2ea74dd9b1.json deleted file mode 100644 index 3d3b53d345..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_db4f1c714b34a8689f89cf2ea74dd9b1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_017itpgP3kmyG3ELoT1DGVxv\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_018KAtUt39zTM5fjb3wF34fX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1266,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":78,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json similarity index 81% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json index fbe65624d5..eef3866538 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_5192c204d173123d2221d39a45ff0dfa.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01UzPDZDmswdSqWxqdcWofhX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019WHr5saVmw41EZT9A2CLV1\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1054,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01YZwohKoQtfeRMPLRMg3gAm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_014FVEYuvKEwJcJwcn69tgaM\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

APPLES

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1057,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json index aafad14e14..2c1f79bd40 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_9dec14ec316359a414e2cb6aecc91acd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01YTcYSN4vGyoLXJgTHAn2d8\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016H1Zipt6cZy5bginnwV4NY\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1055,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01GDpNPwf5Q6KqMuVeo6favd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DbiSqDkXfYaQ4Hg9QKAHb5\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

I NEED TO BUY:

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1058,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json deleted file mode 100644 index 662054c953..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_3d62473ba5dcb800f0e94a6f3c996c9c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01L1d6FvK69vwt2anSYGXd7Z\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FfS8yQEHqFSLfMtbZQBxye\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1182,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_5ff3afb37a8323d9237d5b95694febb8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_5ff3afb37a8323d9237d5b95694febb8.json deleted file mode 100644 index 6e7c58070a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_5ff3afb37a8323d9237d5b95694febb8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01NpjSxqLHYPRFyWSpxSAT8g\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01QJVSJzV3EPVNen8XJUMYd4\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1265,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":100,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json new file mode 100644 index 0000000000..053da5db76 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01QgcZZf3NKwvJNB1DSVT3UN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ANnbxxfAz648YZQRSTJcag\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, @Jane Doe!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1213,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json deleted file mode 100644 index 5e7cc38c49..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_c21d0b742de489f48d10cdb0a2368742.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01DyY38y4gxK48LmPQx5XRdU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012xPFz8KtD5fkwGmemzHJmt\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"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\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json new file mode 100644 index 0000000000..28f329e4c6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01Jdy9CwxcDo7kfxUUnqfhK8\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01J6p8rBvwChN7JHDdeCcQ9E\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hallo, Welt!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1203,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json deleted file mode 100644 index 6ebd64981b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_04e5b18dcbf265726fc60add5d49579b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_019DqHtdJLG4a6vhX4jcC9QC\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Sw5iyZ2vE7orzNcBypiUK7\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @John Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1174,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":114,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json new file mode 100644 index 0000000000..b00264bf80 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01BgsbZCs7s5kFpR51tjfx51\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UqJP3NUYyb3ZRUdaLmaV83\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @John Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1205,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":142,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_ec0dc498f9751250aea1a983b178f851.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_ec0dc498f9751250aea1a983b178f851.json deleted file mode 100644 index 92fc9acb0b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_ec0dc498f9751250aea1a983b178f851.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_011b2voLKMYgWVpQE6YjafHb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Ga1yZjJqyWn7ty71KCSoB8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @John Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1257,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":151,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json deleted file mode 100644 index 234fa02bf2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_011d7335e3bc7e40685788d29b8995fd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_0156SBYqywkbVX85gkMH3zQj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016qpHCM71ThfDh2QuxRobBo\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1191,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json new file mode 100644 index 0000000000..027daebf71 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01RHJ4Nhd3tDRZSTxBcGbCNS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01F1g2Eikj4R2yNvcBdxbcgg\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1222,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":119,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_a3b05a1abb86f585d47c391999382e50.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_a3b05a1abb86f585d47c391999382e50.json deleted file mode 100644 index 7eb2a2d1d3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_a3b05a1abb86f585d47c391999382e50.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01HhjdsqS26d7TFF9y6dnXw1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Xb3ZmSFHar7jUqPirq9CAS\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1274,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":128,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_b2084dd7f9c0ddf8d8069245f9724d2e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_b2084dd7f9c0ddf8d8069245f9724d2e.json deleted file mode 100644 index fbb763244e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_b2084dd7f9c0ddf8d8069245f9724d2e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_017TzxkEmKzVJ4FgGmxJ6E9G\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011Z1V6g1DTEUx6ZNzE4qwyZ\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":74,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json new file mode 100644 index 0000000000..a3a5b69cc4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_018r85SsRrDzypsA4ujv7nWN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01T1jxyGXC85Djzg5J5u9TNG\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1212,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json deleted file mode 100644 index 8c1fe6410f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_e6a5964ece38842634196e2158af46a5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01R8ZbuB1QZ6TYnEQHMJPDfF\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01GkpwVXhEpm8KonwqeLw1dj\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, updated content

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1181,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json deleted file mode 100644 index 57ac0baf27..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_bd32f736daf0ace65c5ef96f85d33073.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01LC4YS2uDRg8WJo7WYiVVJY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DYdkZQLSrbKuGuskAxDpFN\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @Jane Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1173,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":120,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json new file mode 100644 index 0000000000..d4ab0e28dd --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01YVEVQtXvfSew6UJpd3vyt9\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Jf3DrBgo8triWsW1V3VSMe\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @Jane Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1204,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":148,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_d36fe6fd5c56cbb5720b8b5f0f1af4de.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_d36fe6fd5c56cbb5720b8b5f0f1af4de.json deleted file mode 100644 index f49f016a82..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_d36fe6fd5c56cbb5720b8b5f0f1af4de.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Ya1RgsafsDFL77ndHX1jKj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01S8q1rkh93EqiNPJUZpiQiv\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hello, @Jane Doe! How are you doing? This text is blue!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":157,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json new file mode 100644 index 0000000000..9146079067 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01Krvym4gDLgNLdYQUapyi73\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016kvgbrqMbB9bfqwjdznSrL\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1214,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":154,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json deleted file mode 100644 index 4d67f4006b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_166f3480a334b0bb61dd9f71725161c7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_013T3Wfeeu9tAKGHuB35rqHt\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Q72Jd6E1AwQkPcm2nveP5c\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1184,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":126,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_29398a2d44edd12095a50d62bd1bf720.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_29398a2d44edd12095a50d62bd1bf720.json deleted file mode 100644 index 3c8cb9ae8c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_29398a2d44edd12095a50d62bd1bf720.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_019mRrHH2XD4XZoEyqCnjda1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017yAFtTPDQq4NAsEDmY5TNA\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1266,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":163,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json deleted file mode 100644 index 20edf6c0d6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_5c8482500b8bcb18d002dad7d7ce3b56.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QwphcuDLmyKtXonk4r3ghg\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FmZWURVsZ6a5wkrAQVT6VR\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1170,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_664975f8855764c9de57ed1aef74e740.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_664975f8855764c9de57ed1aef74e740.json deleted file mode 100644 index 9f6bb4df5f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_664975f8855764c9de57ed1aef74e740.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01XkCHtffJ9VUJX8e98MNw7e\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_018BPqVPpmS4dDohbp2P67t8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json new file mode 100644 index 0000000000..2857a033f5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01PjTDBrUWPuHpTDJNeuQHD1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0119N72fADZAt8Uvmx6YsSRo\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1201,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_6f48d6dae797621870e22e8e0f572003.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_6f48d6dae797621870e22e8e0f572003.json deleted file mode 100644 index c2b18ddd15..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_6f48d6dae797621870e22e8e0f572003.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01FV1vVtt6bsiubuHojLNDao\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013ERkWA8AJrVHzptowmaHe3\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1261,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":78,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json deleted file mode 100644 index f511152728..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_732a538612df511185897838aca811b7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Gw8pvwFVbtaAhxAmPjs7Bj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DAZNBRj3Voq8H8afsXXccU\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1178,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json index df307b3056..18e4464070 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_408c7874e5c50b9977eef38e60587f5c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Y4wsxmdBRbXY33AZFo2hbr\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01EwnQELvG78Q4tceLYmze2K\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

Hello, world! Bold text. Link.

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1183,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_012rCrjcxddvE9AE1Wjc5mG1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UM13nr1SJu8s5FJDdexVbW\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1209,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_093561699e181778eacfcf52c5b5bce5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_093561699e181778eacfcf52c5b5bce5.json deleted file mode 100644 index 9640af4403..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_093561699e181778eacfcf52c5b5bce5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01T8spnBG6z5k5xBZKdWPP4c\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_019PGzdyqLGqcj9ybkXWD7SR\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1082,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":73,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json deleted file mode 100644 index e146c2911b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_8fa2a7559da234ea5baba7e27d421e2e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_013FegBEP9cn4JkS7Kn8Ejnq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01X2ht322mUughqCbRmCzRLc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":995,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json new file mode 100644 index 0000000000..4f1fc01674 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_012NT1yAWkUcoopyRgAqrTje\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_015jhqZa84VjgNB2WchynAoG\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

Hallo

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1026,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":66,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json index 56c5c6aa1a..17443a1648 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_2857ec14532ecfb9e00636b7cd8e34e2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "{\"id\":\"msg_01Xc8sPBayyZajgeemdHDVXK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01En9MvgKWpWNRk3zvMJi3TX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
  • Apples
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
  • Bananas
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":924,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":110,\"service_tier\":\"standard\"}}", + "body": "{\"id\":\"msg_01B6xgX4Fg5qQbk9f7XExanD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Pwjqa9hyv7aNeCUGuVhpu6\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
  • Apples
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
  • Bananas
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":927,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":112,\"service_tier\":\"standard\"}}", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json deleted file mode 100644 index 13fc10dc1b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01MxLPsRCu839a7hRtMoEQFw\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01FGehiWak3uTy7j1K2syjo1\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":83,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop_1_b37458e2a024cdda800f9b97dfbb7d95.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop_1_b37458e2a024cdda800f9b97dfbb7d95.json deleted file mode 100644 index 8f29af232a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop_1_b37458e2a024cdda800f9b97dfbb7d95.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01M8Rq6dcStHnF2xSixpNWAA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UC3RXXibNUWwd6heTp4RRt\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":81,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json new file mode 100644 index 0000000000..72aaacec17 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_01QVne34B7Zdx4bmJUxGdBM7\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ME4gYYuAELfZtUk87vbqiv\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1216,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1eecd846715894269bcff0f0c8809dab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1eecd846715894269bcff0f0c8809dab.json deleted file mode 100644 index 44d0b1d679..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1eecd846715894269bcff0f0c8809dab.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01YZe4LnxY4HFEqRHTVyxgiX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Sv6GoUpisX9N5VU49FDnrn\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json deleted file mode 100644 index 531bf50e7b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_766a8e965e9476fd9073925774f2b18e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Vpd9WNn7B82MsWT8z1tq23\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01WpwBEhfywBdWgeTEiPfSAB\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

What's up, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1185,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json new file mode 100644 index 0000000000..679119c0f7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\"id\":\"msg_016dq6hsmDsEPUqfgxq9PU1U\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TsByXY1QwhkmbxwegXjKa8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1203,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":54,\"service_tier\":\"standard\"}}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json deleted file mode 100644 index e317cf4066..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\"}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_015uUFHwxXLw3ozHgZTizdoq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01KAKohUgYRi4oitWPmfzodk\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":75,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json deleted file mode 100644 index 625ed00bba..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_9abd187cb14c5c3012da9eac6dff51ad.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01WP6HSxkakh57sdDnFxm3dL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013NBHoE5UrvQSwKwfyaMcDT\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

Hello, world!

\"}]}}],\"stop_reason\":\"tool_use\",\"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\":66,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json deleted file mode 100644 index 5e98bf4545..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-f38d95e3-c265-45c6-a279-5fde0aa8ba1e\",\"object\":\"chat.completion\",\"created\":1758112754,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rqfr2rp20\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.093303647,\"prompt_tokens\":859,\"prompt_time\":0.065896195,\"completion_tokens\":59,\"completion_time\":0.125717433,\"total_tokens\":918,\"total_time\":0.191613628},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzarke2krsbcczn0tpxzd\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json deleted file mode 100644 index 11cf5bbf33..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-15cf615d-e36d-463b-b84f-467e3afc49ec\",\"object\":\"chat.completion\",\"created\":1758112753,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rtjxcxane\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.08603614,\"prompt_tokens\":960,\"prompt_time\":0.089924362,\"completion_tokens\":39,\"completion_time\":0.076131604,\"total_tokens\":999,\"total_time\":0.166055966},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz9bbe2e9cky4eb929xp5\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json deleted file mode 100644 index 4677123f06..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-17b67970-fce8-4ccd-881f-66a47540309c\",\"object\":\"chat.completion\",\"created\":1758112761,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"zdvrkac2k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085895811,\"prompt_tokens\":954,\"prompt_time\":0.11500097,\"completion_tokens\":37,\"completion_time\":0.100138151,\"total_tokens\":991,\"total_time\":0.215139121},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btzhacft79zdq5ybcf2a3m\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json deleted file mode 100644 index 6aedd8f681..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-afe0dd8d-8f02-482d-8c3c-4cd3841d843b\",\"object\":\"chat.completion\",\"created\":1758112751,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"wyhg98e2e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166522262,\"prompt_tokens\":952,\"prompt_time\":0.08071759,\"completion_tokens\":52,\"completion_time\":0.101782396,\"total_tokens\":1004,\"total_time\":0.182499986},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz7vsfsstdcgbb40zs0nn\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json deleted file mode 100644 index 2baffa3f60..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-39f097a2-667a-43bd-a17d-b0c9d3cfb644\",\"object\":\"chat.completion\",\"created\":1758112746,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"57rvn6p5a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084368128,\"prompt_tokens\":943,\"prompt_time\":0.079126227,\"completion_tokens\":34,\"completion_time\":0.107007369,\"total_tokens\":977,\"total_time\":0.186133596},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz320fse9934j938wrqbr\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json deleted file mode 100644 index 8dd15f6f5f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-f9e71b67-5450-4d12-8d2a-a7d3f6779d55\",\"object\":\"chat.completion\",\"created\":1758113299,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"ssxg295zp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166768861,\"prompt_tokens\":945,\"prompt_time\":0.08303688,\"completion_tokens\":99,\"completion_time\":0.171461053,\"total_tokens\":1044,\"total_time\":0.254497933},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5bvfya4etvvr7te0etzxgwd\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json deleted file mode 100644 index 07864a1877..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-f35a51e6-0767-46e5-8fe9-5f3243dd9539\",\"object\":\"chat.completion\",\"created\":1758112750,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"b7fa0erb6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091975708,\"prompt_tokens\":961,\"prompt_time\":0.072977039,\"completion_tokens\":81,\"completion_time\":0.152069195,\"total_tokens\":1042,\"total_time\":0.225046234},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz6mce2c9j37txcw4mgz5\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json deleted file mode 100644 index a8475cb169..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-5fbd9d89-9eec-4d84-b463-3eddbd80a572\",\"object\":\"chat.completion\",\"created\":1758112749,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"kmg5kk4w3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085052088,\"prompt_tokens\":951,\"prompt_time\":0.085216352,\"completion_tokens\":29,\"completion_time\":0.061744151,\"total_tokens\":980,\"total_time\":0.146960503},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz59dfsmajcxeejyqggw4\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json deleted file mode 100644 index 20493638d7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-f2beaf21-728f-4721-bde7-39f3e9b6a577\",\"object\":\"chat.completion\",\"created\":1758112761,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"e1n61yp7n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.092638797,\"prompt_tokens\":943,\"prompt_time\":0.071674968,\"completion_tokens\":103,\"completion_time\":0.196202009,\"total_tokens\":1046,\"total_time\":0.267876977},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzgwse2w9q8qk6bxjy5bt\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json deleted file mode 100644 index ae37307f1b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-9ea03bff-b285-4f80-9581-30560fb6c33d\",\"object\":\"chat.completion\",\"created\":1758114034,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"9h12d96qx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.169492052,\"prompt_tokens\":952,\"prompt_time\":0.084552484,\"completion_tokens\":106,\"completion_time\":0.221967353,\"total_tokens\":1058,\"total_time\":0.306519837},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5bw6c6hft4tprrdvae7hsn8\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json deleted file mode 100644 index 5ed73dd9e2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-a346e7b8-2182-4ff3-8935-ea413dbb19a5\",\"object\":\"chat.completion\",\"created\":1758112751,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"px83b6d45\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.142623814,\"prompt_tokens\":941,\"prompt_time\":0.091884803,\"completion_tokens\":37,\"completion_time\":0.107921431,\"total_tokens\":978,\"total_time\":0.199806234},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_21854da540\",\"x_groq\":{\"id\":\"req_01k5btz7eee2d9mepg4at5g36p\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json deleted file mode 100644 index 44df58c49e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-b92eea24-5531-4528-8487-ca270422a1d3\",\"object\":\"chat.completion\",\"created\":1758112750,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"zdf0b0jha\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166605488,\"prompt_tokens\":948,\"prompt_time\":0.082441187,\"completion_tokens\":33,\"completion_time\":0.101207657,\"total_tokens\":981,\"total_time\":0.183648844},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz71afssa311s15cqgyeg\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json deleted file mode 100644 index a4b6be3614..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-bad78f23-6ea6-4c25-a8b1-51b174cc57e6\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"4g9v9nsj8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084155641,\"prompt_tokens\":784,\"prompt_time\":0.065738539,\"completion_tokens\":31,\"completion_time\":0.065473216,\"total_tokens\":815,\"total_time\":0.131211755},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz3cyfsf9829x9p7wb4xm\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json deleted file mode 100644 index da74d72657..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-1aaf21f4-5b17-4459-be76-92812db0b518\",\"object\":\"chat.completion\",\"created\":1758112748,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"t6ssv81cm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084567259,\"prompt_tokens\":955,\"prompt_time\":0.081947819,\"completion_tokens\":37,\"completion_time\":0.112192401,\"total_tokens\":992,\"total_time\":0.19414022},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz4yje28aw8rghzat58e0\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json deleted file mode 100644 index 7971a544f8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-43a0de16-23b6-4717-ad83-ca37bff9e2ce\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"dz5xb4324\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.168558608,\"prompt_tokens\":943,\"prompt_time\":0.08278354,\"completion_tokens\":39,\"completion_time\":0.091890941,\"total_tokens\":982,\"total_time\":0.174674481},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz41ze28bqdv9pc5a0q2d\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json deleted file mode 100644 index 57a4d0ca14..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-85f0a2e4-8e9b-4d3c-b6c5-4c0c093a78c3\",\"object\":\"chat.completion\",\"created\":1758112748,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"f4b00zjw4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.087940401,\"prompt_tokens\":955,\"prompt_time\":0.078279455,\"completion_tokens\":33,\"completion_time\":0.098377544,\"total_tokens\":988,\"total_time\":0.176656999},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz4hwfshshkb1ts5mp7bs\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json deleted file mode 100644 index f619fe5733..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"chatcmpl-2b9b0382-1f84-42be-8cc5-a96054e54e2f\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"en68vcxcs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085493777,\"prompt_tokens\":943,\"prompt_time\":0.086119742,\"completion_tokens\":35,\"completion_time\":0.104937445,\"total_tokens\":978,\"total_time\":0.191057187},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz3pafsf8bxt0makhgktn\"},\"service_tier\":\"on_demand\"}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json deleted file mode 100644 index da7f34a0ed..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsbheef2rj1fq7zs1kb81\"}}\n\ndata: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"g8y38s3cd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsbheef2rj1fq7zs1kb81\",\"usage\":{\"queue_time\":0.083550265,\"prompt_tokens\":859,\"prompt_time\":0.070453057,\"completion_tokens\":59,\"completion_time\":0.113175937,\"total_tokens\":918,\"total_time\":0.183628994}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_f67f3cef3589a8792080e7fb090b1226.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_f67f3cef3589a8792080e7fb090b1226.json deleted file mode 100644 index 668bda0918..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_f67f3cef3589a8792080e7fb090b1226.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsa0pef1s2jw8rnshdap0\"}}\n\ndata: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ft46cn5tk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsa0pef1s2jw8rnshdap0\",\"usage\":{\"queue_time\":0.087974126,\"prompt_tokens\":960,\"prompt_time\":0.08541297,\"completion_tokens\":35,\"completion_time\":0.076046468,\"total_tokens\":995,\"total_time\":0.161459438}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_9056181b23b2cd23325d52c3eeb6ee16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_9056181b23b2cd23325d52c3eeb6ee16.json deleted file mode 100644 index 1a75bf45a2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_9056181b23b2cd23325d52c3eeb6ee16.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btvsgdejgb6stkz6a17920\"}}\n\ndata: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jz9p98nqx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btvsgdejgb6stkz6a17920\",\"usage\":{\"queue_time\":0.168634066,\"prompt_tokens\":954,\"prompt_time\":0.079230455,\"completion_tokens\":37,\"completion_time\":0.105188936,\"total_tokens\":991,\"total_time\":0.184419391}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_5ac53cae2b0994f5de466affabaad58e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_5ac53cae2b0994f5de466affabaad58e.json deleted file mode 100644 index ef87f46ebe..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_5ac53cae2b0994f5de466affabaad58e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts7y0fswts6h6qj05a7m6\"}}\n\ndata: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"msaf9c1mm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts7y0fswts6h6qj05a7m6\",\"usage\":{\"queue_time\":0.087923681,\"prompt_tokens\":952,\"prompt_time\":0.07852597,\"completion_tokens\":52,\"completion_time\":0.106581181,\"total_tokens\":1004,\"total_time\":0.185107151}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_a534dfa8d9008a473a02fcb64bd645c7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_a534dfa8d9008a473a02fcb64bd645c7.json deleted file mode 100644 index e1cece25c4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_a534dfa8d9008a473a02fcb64bd645c7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts3jyeentda86a69tbemv\"}}\n\ndata: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xkhx0v1vq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts3jyeentda86a69tbemv\",\"usage\":{\"queue_time\":0.083582984,\"prompt_tokens\":943,\"prompt_time\":0.094921281,\"completion_tokens\":33,\"completion_time\":0.082310853,\"total_tokens\":976,\"total_time\":0.177232134}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_db0b2afe5c635db1fbd2fd9e5c66c2a6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_db0b2afe5c635db1fbd2fd9e5c66c2a6.json deleted file mode 100644 index e094f8e748..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_db0b2afe5c635db1fbd2fd9e5c66c2a6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts663fstbh9a4e20770f8\"}}\n\ndata: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1mq7f22g9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts663fstbh9a4e20770f8\",\"usage\":{\"queue_time\":0.173206301,\"prompt_tokens\":945,\"prompt_time\":0.073079821,\"completion_tokens\":99,\"completion_time\":0.171283529,\"total_tokens\":1044,\"total_time\":0.24436335}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_698e87bd13c88c31da2b4d97ed62aa8a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_698e87bd13c88c31da2b4d97ed62aa8a.json deleted file mode 100644 index 7c9e102f03..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_698e87bd13c88c31da2b4d97ed62aa8a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts6p3fm494z6krgkes82h\"}}\n\ndata: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"81ksqccr8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts6p3fm494z6krgkes82h\",\"usage\":{\"queue_time\":0.168064995,\"prompt_tokens\":961,\"prompt_time\":0.079313259,\"completion_tokens\":77,\"completion_time\":0.122062332,\"total_tokens\":1038,\"total_time\":0.201375591}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_54e5c87345fd2adc7bc1aa015fb7ed49.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_54e5c87345fd2adc7bc1aa015fb7ed49.json deleted file mode 100644 index 68113ca3a7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_54e5c87345fd2adc7bc1aa015fb7ed49.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts5vrfst8h602n8wn8rha\"}}\n\ndata: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"v3q0a7nxz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts5vrfst8h602n8wn8rha\",\"usage\":{\"queue_time\":0.083994451,\"prompt_tokens\":951,\"prompt_time\":0.085350612,\"completion_tokens\":33,\"completion_time\":0.063110548,\"total_tokens\":984,\"total_time\":0.14846116}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_fc03fd7d02657b4546b13e3e8a3a2bee.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_fc03fd7d02657b4546b13e3e8a3a2bee.json deleted file mode 100644 index 196da262ec..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_fc03fd7d02657b4546b13e3e8a3a2bee.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts8ateewv2956kdm9j0aa\"}}\n\ndata: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"edhdg14fc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts8ateewv2956kdm9j0aa\",\"usage\":{\"queue_time\":0.938343215,\"prompt_tokens\":943,\"prompt_time\":0.063132737,\"completion_tokens\":103,\"completion_time\":0.19462829,\"total_tokens\":1046,\"total_time\":0.257761027}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_ae27bd5c696279c7555747ebab7f882e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_ae27bd5c696279c7555747ebab7f882e.json deleted file mode 100644 index c50bbc5948..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_ae27bd5c696279c7555747ebab7f882e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bw6k3eftat11dw62ej1szj\"}}\n\ndata: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"9kesd5caq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bw6k3eftat11dw62ej1szj\",\"usage\":{\"queue_time\":0.086288085,\"prompt_tokens\":952,\"prompt_time\":0.078529108,\"completion_tokens\":106,\"completion_time\":0.220582491,\"total_tokens\":1058,\"total_time\":0.299111599}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_ad1bbdc50acb8c57cbcb55e00134b956.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_ad1bbdc50acb8c57cbcb55e00134b956.json deleted file mode 100644 index 49b5955420..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_ad1bbdc50acb8c57cbcb55e00134b956.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts7gxeesv2t1vpykap3mz\"}}\n\ndata: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1zaggbzc3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts7gxeesv2t1vpykap3mz\",\"usage\":{\"queue_time\":0.168522711,\"prompt_tokens\":941,\"prompt_time\":0.078302178,\"completion_tokens\":32,\"completion_time\":0.101855477,\"total_tokens\":973,\"total_time\":0.180157655}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f65378b4068dbaa6e4b2f12247582a3d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f65378b4068dbaa6e4b2f12247582a3d.json deleted file mode 100644 index fa47b296e6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f65378b4068dbaa6e4b2f12247582a3d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts74vfsvrwsv9w1chvsvy\"}}\n\ndata: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"s9fa8e59a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts74vfsvrwsv9w1chvsvy\",\"usage\":{\"queue_time\":0.08485247,\"prompt_tokens\":948,\"prompt_time\":0.123735528,\"completion_tokens\":37,\"completion_time\":0.099621307,\"total_tokens\":985,\"total_time\":0.223356835}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_a4057cb73ed9ba6b58bfc3440182ab52.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_a4057cb73ed9ba6b58bfc3440182ab52.json deleted file mode 100644 index b48635176c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_a4057cb73ed9ba6b58bfc3440182ab52.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts3ymfsp800e0zax86yzz\"}}\n\ndata: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"km811vn9v\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts3ymfsp800e0zax86yzz\",\"usage\":{\"queue_time\":0.087360349,\"prompt_tokens\":784,\"prompt_time\":0.072817523,\"completion_tokens\":31,\"completion_time\":0.069651957,\"total_tokens\":815,\"total_time\":0.14246948}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_cd366ecb6835f6ad416e56246d772258.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_cd366ecb6835f6ad416e56246d772258.json deleted file mode 100644 index ef4715520f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_cd366ecb6835f6ad416e56246d772258.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts5e2fsrt8h67zd36rpxp\"}}\n\ndata: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z0pge0x85\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts5e2fsrt8h67zd36rpxp\",\"usage\":{\"queue_time\":0.087500214,\"prompt_tokens\":955,\"prompt_time\":0.078356795,\"completion_tokens\":37,\"completion_time\":0.097712926,\"total_tokens\":992,\"total_time\":0.176069721}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_dcd828e95a6f35a02dc80f83ce865246.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_dcd828e95a6f35a02dc80f83ce865246.json deleted file mode 100644 index adcc4e4911..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_dcd828e95a6f35a02dc80f83ce865246.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts4mzfspsqm4xwzd91wf1\"}}\n\ndata: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"apredbe8r\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts4mzfspsqm4xwzd91wf1\",\"usage\":{\"queue_time\":0.088002713,\"prompt_tokens\":943,\"prompt_time\":0.078793395,\"completion_tokens\":40,\"completion_time\":0.097069721,\"total_tokens\":983,\"total_time\":0.175863116}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_b409676f3c38fab14dbfcf469c084b61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_b409676f3c38fab14dbfcf469c084b61.json deleted file mode 100644 index c7c8119abd..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_b409676f3c38fab14dbfcf469c084b61.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts4zzfsqrfp0fyy163dt9\"}}\n\ndata: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b24egqjg9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts4zzfsqrfp0fyy163dt9\",\"usage\":{\"queue_time\":0.1979395,\"prompt_tokens\":955,\"prompt_time\":0.07950067,\"completion_tokens\":33,\"completion_time\":0.095139914,\"total_tokens\":988,\"total_time\":0.174640584}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_8035279de2d825570eb857243ac085d3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_8035279de2d825570eb857243ac085d3.json deleted file mode 100644 index 21daa4e556..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_8035279de2d825570eb857243ac085d3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts48meenr0hj6z714yhxx\"}}\n\ndata: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"he64mpmrs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts48meenr0hj6z714yhxx\",\"usage\":{\"queue_time\":0.08358156,\"prompt_tokens\":943,\"prompt_time\":0.076520558,\"completion_tokens\":34,\"completion_time\":0.094223127,\"total_tokens\":977,\"total_time\":0.170743685}}}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json deleted file mode 100644 index f9ca1fd98d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpwx2RQ0LVAK1I6w2BRQFtYruln\",\n \"object\": \"chat.completion\",\n \"created\": 1758113168,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_gZIhS8D8Z9JAF2SVhjNWIPqU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 584,\n \"completion_tokens\": 47,\n \"total_tokens\": 631,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json deleted file mode 100644 index 9b2ba008b8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpAWlte92kIl2f9A9kHnqu8XES3\",\n \"object\": \"chat.completion\",\n \"created\": 1758113120,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_imzrtOZGFz1s9omW7bcoollU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 686,\n \"completion_tokens\": 33,\n \"total_tokens\": 719,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json deleted file mode 100644 index 9914fcb869..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlp9sr1rYwNMrP31lNFvsosQ4zn6\",\n \"object\": \"chat.completion\",\n \"created\": 1758113119,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_X0ZESjpEJKJRLw5J8XgcaKGk\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 31,\n \"total_tokens\": 711,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json deleted file mode 100644 index b68d995d68..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlp5apxCCSU4sFtS6yQmbfhgB4cS\",\n \"object\": \"chat.completion\",\n \"created\": 1758113115,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ODa5TdGkQAlxyYMNMeM6coTC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 678,\n \"completion_tokens\": 46,\n \"total_tokens\": 724,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json deleted file mode 100644 index 3c255fc164..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpsPfSrQUOKpv9mBoFHN2tItfe5\",\n \"object\": \"chat.completion\",\n \"created\": 1758113164,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_949cpRoT42WwPHtFvtX1FvVU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 27,\n \"total_tokens\": 696,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json deleted file mode 100644 index d8f064bcd3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlp064VAVhIK0UMTwVhyGvvXSXsT\",\n \"object\": \"chat.completion\",\n \"created\": 1758113110,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_LQq5m49qgLR665YfthaspG7j\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 671,\n \"completion_tokens\": 92,\n \"total_tokens\": 763,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json deleted file mode 100644 index 9f0f02fe52..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlp1NdCoLR5HgEMRJbyFernIXUKA\",\n \"object\": \"chat.completion\",\n \"created\": 1758113111,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_d7hZ0WdZ8axSKBUEhxfsepVs\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 687,\n \"completion_tokens\": 75,\n \"total_tokens\": 762,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json deleted file mode 100644 index c28db2a8c1..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGloxZe4V8SlYBvP21NT98YT2PPtR\",\n \"object\": \"chat.completion\",\n \"created\": 1758113107,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_r9lIIgu3ZUqDm65d12hoyaLv\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 677,\n \"completion_tokens\": 27,\n \"total_tokens\": 704,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json deleted file mode 100644 index 756d2d2ab2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlpvneyvt2nNfiKmKhbNcNYrETJV\",\n \"object\": \"chat.completion\",\n \"created\": 1758113167,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_oytgZ8tpjilbUS53oydQUNNx\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 97,\n \"total_tokens\": 766,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json deleted file mode 100644 index 83ec928424..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGm0Rr5P6XVqBQgrHxKBUlndWbXYo\",\n \"object\": \"chat.completion\",\n \"created\": 1758113819,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_47oMXXPcHa4J262YeEJoHFeq\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 678,\n \"completion_tokens\": 98,\n \"total_tokens\": 776,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json deleted file mode 100644 index 710ce9c96d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlp4Hm12y4LWW5x0vhf7XgQr9MFa\",\n \"object\": \"chat.completion\",\n \"created\": 1758113114,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_I8LJcWHLwAdkH5ts8H4mrMyr\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 667,\n \"completion_tokens\": 30,\n \"total_tokens\": 697,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json deleted file mode 100644 index 90865991ce..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlptLXZLEsTWi68AQdGKoO3BzJH9\",\n \"object\": \"chat.completion\",\n \"created\": 1758113165,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ZpR6nsavPQ6W5cUTsVYD5OJh\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 514,\n \"completion_tokens\": 25,\n \"total_tokens\": 539,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json deleted file mode 100644 index 8d0fa754cf..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlowWqmaxfWdrTIVuBTcRXqK4235\",\n \"object\": \"chat.completion\",\n \"created\": 1758113106,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ndvyBVPg1bKsLdOjF81G4XRU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 35,\n \"total_tokens\": 715,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json deleted file mode 100644 index 3c899abafd..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlouS0HncqihX8gYRpr7G6nfphBB\",\n \"object\": \"chat.completion\",\n \"created\": 1758113104,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_1JzXjttmViSXqo0opDWlbZu0\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 34,\n \"total_tokens\": 703,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json deleted file mode 100644 index fdce9246c5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlovYQSBXxrxIbFpVLYLoEShaqJF\",\n \"object\": \"chat.completion\",\n \"created\": 1758113105,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_THaTB7qDviTchtsK9bdjkVqV\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 30,\n \"total_tokens\": 710,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json deleted file mode 100644 index 8a745fe0ba..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}]}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"chatcmpl-CGlouLC2ZRPTkKS4CDb1aWBs7gFIt\",\n \"object\": \"chat.completion\",\n \"created\": 1758113104,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_xgH45zkO5MJPPu4jHoui7W2V\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 28,\n \"total_tokens\": 697,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json deleted file mode 100644 index e677d8ea44..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Colored text

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Aligned text

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Zz3IN1l5ZvHuVQk3yXE7jDj0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T7dWysYKBYumw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CIfVg81j0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t8FihHDW0E7EElr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OTuoizctw0PqLSw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kUlZVQb3mBHAvJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DK708aGh0pSh4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rDR0astx2Df8hj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DG1sM7SXoKMZGK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w6lTeyMvshgbmy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8gEUMY41ft6krO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"L4fFI7VW2bBuKO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5j\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ck\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Colored\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NztaqClnckJJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Mf8Dx4vGPcB22V\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1n4v4HlXSSchQj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K3mB6lQs1dzuD7g\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ecYXNLuzRjOmks\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yB6DI2bRDP4hf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aDN5DzfFqop67i\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5BTHwCX0qZP7Bv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bShw32Uv7mFbOT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E9Bb68fpeXRGoB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sEIgK1HMwOPvtZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"um\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Aligned\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yChYufzGWpa1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mlC0YqoKeS57NB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"IHM4AhM\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json deleted file mode 100644 index f2e0359132..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FibEp39c2dwlK9lBWHjMdw17\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K3vjJkyQaNFQz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hct1aWjMs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"asjcTyMy4DV9hAm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IWW2lMisLZL6wtZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lmZLPg5IrgPMyT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OgcjwYHwAY4BZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0sqGWQrclJrjeT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lrHaw4WQ234l5R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ns09Sp99DNua0q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lfYIrTgh2MSN6b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z7FFe0VQcrIec6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4D0rKtnexNNQ9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0zwwXGXbomS3Sq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6C26mFzEl2yZTmq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ty1KLoG14soPMX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Dp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BaXh4nXw3zMaNT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"eYbWWjF\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json deleted file mode 100644 index 1b453d0937..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Co6wHgEr9Xaf8UQu8OMXeHs0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"doHRduwyR8h1G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eg6dGMMg7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qfzXrf5FHbqMeB3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UE4YMhcgI75gwdy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TSD0TsV6gAdmHU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ctp74X73DfkbS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vd9G5tHdsVvGWF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iND7tqRRtr0uQ4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xn2Tqa7e5gdXV5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sAgomUBAqBa0bJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S0KMYyrbQ1BES4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ndsnCNlOhdy6h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9KvFo2KR6Bma7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ww\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OeYHQZZODm1thx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wr816bxgxApNuW\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Io\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"42GNNPSnYRqMgm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"oOm2aoA\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json deleted file mode 100644 index 4339b38e30..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wJ0Hba3RSejz2uGSi9c8vhE7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CCQ18Z9uHI89O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PAHni5CBt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gg8v0M4Dm5nmjmF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PUElsIGfVoJl8JU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9ty19RLdRgo5mw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tAA2RJSGcHMML\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ImtzTAVezBolLQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I4KpV9EhjGBli2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Aw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3sK9254ypyUazN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UTps6pjzxjI8v1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xh3uL4ZQZ5QTXd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"el\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"APP\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"LES\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"jR5Sc6d\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json deleted file mode 100644 index a3b2764132..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_aEHHHFgRQIveyPH0BPZc68nA\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zipP0HNuqDJ8k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fqvQbegTc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B5PI41PRvsaLjJ1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2YCYMbfv7EybSmU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3wqJPa3MQspdVH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WH0fdAcrlzK8m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"veKzS4x3pnspZN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YDINyWzdCTXqvK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"smfW93NpZstGZO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NDAdEaKVGzvtWY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CTBzYfxsJHQG8T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">I\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" NEED\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ChS7YmO1aDcZ4U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" TO\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" BUY\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XglauzKFhVgh8ld\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"hhBYNTx\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json deleted file mode 100644 index 7e0c991940..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wwFTcxLzWQnCoL1QCFGPesPZ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f3VwKvaieKZAK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UI8qBj5GA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TzxP7kk2GkSmHmt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YxOKHLp8jn9VQ2k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G8WAFmPF35ydze\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mJNDFOlb2cmFk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lK7zpAJm7SkNm4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5wGWzDf89ILlKF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8MC8V4VGE31vbL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zZn7kD20yXnlog\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JQPiJorZ78lQJY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e09i6JxfHTbII\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rXKZsRHvns1R497\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZPtwlCufftS7yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jVBHsfABq4mD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GgtbMKvKm1X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zXDYzS8RDoU4cR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hG1QPmdX1RYpUI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"58wd6hSxhbpo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DV5mlu19XQtEQ6b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"D0GLcbolpaqph3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EnuF7vqCvspMLX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"49LJs7kjpUNOMX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tc2qUhQmRG4xg8Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gcS5Lio65QTYQzK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n9ssJRnXLQNFEa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zSFCJOQ4SFiO2IE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AflwXpbkRps6scZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6l\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"GOVM2bc\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json deleted file mode 100644 index fe99dedec6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_P0hIbY9csH634LsFOYdX0i7y\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UNsiwOVDTCcS3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DHTxeJLe2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q8fYrGJssbZqdTs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oxey84suk8AGtO2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LkVjj7TgV3QKhc\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qU5S05qnCnsTg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a2m5wc8R1THxWY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"z\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RVujQrbE0qCC9V\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4n\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KR\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A4FMGWwtRyT7TN\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vGUCQv7ZYYZOxs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"58F8YYrNNEGXrg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ze\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YV\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VR\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a6othEOgWP0FEq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SF\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Welt\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sJeJxHQccwWETs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8x\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"pnmOFEZ\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json deleted file mode 100644 index 0619dc2b71..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_zgIwhvhmFK2ZVEOkyecnWkuG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hIom2g3hTsuE2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0uMDliPzF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XlNRhnblj2ANOAq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3ZzimQRVqpkwU6X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"v82eLdVrbN8lm9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UJzRoWW3A8L95\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A8T3HQqlPi6u66\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q064FJd9BQgOKJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6k2CLWTfcHmm2y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nM94aZZyNlpTDN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c9xGAQen7XHQiy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"im\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bqXKnKTJXH2sg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"poI0DUiS28hZZuU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m7W10BNmLvLgvL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NvDLzGTrZN8D\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3RgxTBdru9x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wx91RCtY9Vfry4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tJUoHq83wJPgqR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VNC4ZssroXJB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ExwOhKdSCFlqJm5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bCz8Xbj9A2tNRv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"V9bsRIh5lvLaKA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lvnf8Cov9g3w0v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IvJNWoH5WVbgXGz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7TQ0uwpZHSPfujf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bQJKvTmqRoROaZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8sec2EhlFP1Bknb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TXhgqHV6IgyBoqQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ew\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3W\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1oj6FL78tVGnu7f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DSeRo2UhETYNnwA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"W8zkzb6VodEkhU4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kJTIQBPvi7T1B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XiQLpDU1kqfu2z7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IIT6wUUuxwmem\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YDHkEsWUXkuSF3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HTTuFaCgYbjfUc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dyluv5wJ0aXr5yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ek8EPiEQ5hUtfGw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3kAQnSSPpFlmGd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XHR601dLRK4NE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8EiqjoQLv7cGgA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z8wZZJ9FhWV7i4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"owI5Qe8R4KCS0L6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E0onIef85aeFcr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8QImAuNJwKJ2nvY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dhkvb1lfWPUAxG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NcnIdxNwYtwri\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UiSkD513sCtkxY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EDnfjrVV5VbgbZF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R0vbz7d52UUCnM6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ALbHlHEm3hh8qD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fWCTNu5RSkEjCr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A3GDxMBZtJ1i2LI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hHdJQ81khnSSdN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DpEBShtzw8tEkp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZcLN3y3P5hlvhYa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ugBOYRoQe9e3vs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4fH4JpaSG4cVZT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"a6kT3fO\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json deleted file mode 100644 index 89d2aa2a14..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_gCqwKhdbYSKOEjVtR4phy2sd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mGLKmRzCzTNYk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9Z1GRCwyx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"L03kRWc3mtd7007\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lgakSWwa4W0DgkY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YO7FBfvyamZBYg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"stQsgUcnlko4v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SnSWgcD1JZbXIz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AFsem2Pt3k8VU6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f5ez1DQHkhqKaD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BNUvA6Ozx5ZvEe\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UTL78Zkv7jtxhr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"k3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"g4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PPoh7KHJgFrKK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yEQ4R1Aa6ADFD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"osia6dxo8Yl1Dfd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pVwDuT6MMsBiVkK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UyBd7lQeDKxJp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Rl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q1aCSDAwAwB2Ckx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"12I1uaOE0KhWh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vtPDH6wb1mIUEb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iKVdTjqWquMbVa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l4ugremOI5fSO8U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7I\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"j4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tgR7uATVBiUh7dq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i8nL8APW3IK41n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0vyCtyAr4RwK5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JtL0of0vtgE3J0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nVN0AFrnsxscmT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5CzPV3rKPooTotN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lyEA0znKGbGckz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QA8iDGFwZ3q3yh6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n2oCnEVzfmbI1E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t7z5yUbGaBYIW\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oiHhVQIurUoMpM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CvcF4IasPbKRVrr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fue0FckHm3tK8hC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gZ1QIjmtQqhqye\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yvPDDln32HHhER\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TpSRxk0iRE2wbiJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iLUEuhyocydhTM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dOY2mcuAWYlkwo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E7cdIor6vhZ8wG6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IVOrjXvXXpJmuT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UIcjBzQXbfJHvZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"CrSZ5y3\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json deleted file mode 100644 index b1d1d9a5f6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wULMFRSMft8fh56epwdGrqy6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aoevi0DDtNh16\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HNGtzJQ9b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wirlzLSlEhEYiI4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"etOhhykCigvi8CV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F6YDMM5r7mbKni\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6r5gzsWpR23nq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ffe1SUb2PM4GqY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eXD6qYJ6W9Czcw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XfHnz1TdTNPLyZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7NiVzhanDdLk7Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cTVoV0ccgTGMzs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TTghqw8qGfZSr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"COHUDHJoMyL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TjfNgGQbklB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"dq0tgwP\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json deleted file mode 100644 index f2ae03e965..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_X5ydBQ491eTVFvhZEmswKxdC\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"adnzhpKGnZsfx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IJ8efOzhB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yZaNJkdnUxfLkvO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pz1hoKOo4MtC5PV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wq8TlvceL4xVD8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FdrGZxlh8duXJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d8XyqlMC3Fh9Oz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1B35RylRbDf9Ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ELo40sUPkjcio3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2ZXov1ckExB4KG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BIqhmuh7zkjsnI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Og\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FKxyaNbvD27ua\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ToOtCW8D4JOoxgN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E3yY6eTOTYvD5j\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h7wArQroYLHB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O2HLkxr4x1a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Bs0rM24sLHH6mY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lDlXlGcJdn6Tyl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fQNW29hVC2V1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f6yl0FusYwPRqTu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gXtYVoUV4FLikL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uxHtP3nf8GcKjB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"H2wU5J3pjMDf78\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N8XUGAa2oYgyF8Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"shtgf8TgxDzbItj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X8LM6NesmKXSrf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aOM8Pq2wpmT7xhv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nJYL9BVBROejab0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BbX3OWSlYjf1F\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pMue3mUgD3ZsmIz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AwteSm500AhRwN7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p1ZbUOhBamqpm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Cw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KuocQPEVdCulDw2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B6kbrfqrLj3b1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1pVz9B1bRTlR6n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VuC4AjYWh7J2xr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Qc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KChNCOsK2BY1pqa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"un\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c9J6Hw9PxFNF2EM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tcO78Tfzh6isfh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yRW76PdAuiwax\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eq13V0aIOjkulO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3GzDop8wKmSl4T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mDUYmJY8YOc3TEf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"esBXDQRcSBEl3J\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IY5cyVGOjwR9EE7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NGxu7EwiWDE3pA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ElxOUGTzPuV2E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NO9LHhn2W1R2Bb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NvFMyr8kvBMcJoh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cpgKkYSDSo68Ikz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8P6vT7HxKTjlU8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QOITqd4cX376OE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CqsrqldlqkP7iaY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xxxrBpuPTxqcLH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nVC8f1hHZoErft\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bnwOKp6I8m8FKsN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hsFkFrGhInIOPu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IjKKUaiT5AZU1M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"62eum5p\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json deleted file mode 100644 index 7e779ea5ba..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_tHSCTvtI6Acntrx5tbN10SRh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b3iEK3BayquS7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q4V191vlz\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AtDVEkI3NeTE580\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S47plaf3XcsUp95\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"knpZ3SufiWVMkF\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LCG0BPZ8sEqgM\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vV6mYaeXoZPFfX\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"V\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zxzNV7nNRU7vhX\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NZ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I5\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"acLpgECyd9IdNP\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ml5gZuVDteXND7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bCFJSjmXPARZpy\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qO\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1W\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K5kbxXNRkk2ERT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0R\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"j\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TiOMzTHNBBSAc37\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f4GRlE7ZOVOMk0\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jI6TvXwq5SwS\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WOAjSkst1hl\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1TQUuNMV5gE1KE\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qynnGst91ounGA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FvaazK5eYG8x\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lHh3QFwfV79RSYw\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GLpMV8LVV4NqAq\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fx6lWVvvw5f65T\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2GDUUvlJS7J2ap\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e5DFkHoG7B4eOWu\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ta7ph2mgvkEjc0u\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pSUlkrWYwYhdw5\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P9HcUpwbMYNMsEt\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P6nPb9MF850I81l\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7z\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7xST9ZyMJa3ZR\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" geht\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JmYDZtdjBYb9N3\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"82djkDSIGdzapDS\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dV\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"o\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MdX0Qly5qJ7PDaD\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VBVl7AN2nYv0y\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CWaAhKJEzZTsv7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zoUT7lYgfd48lN\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ly\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aFvGcpAXvGUyu8x\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0D\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"py\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Qq\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rYdjNX87bF7Eiyb\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AEzeoAj0KJY3Lt\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TTGxdVe9fYQPC\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p3260pvjD6kKya\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G6ILvnWaZ44PBr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2tV6qRa0rslWV5f\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NBgNzlSXQaxZt9\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LsPPWqRNgMxnRPA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5jhssj6qeYShUo\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i8BKf2ELw8Ybs\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5xuHVNV2eUn4wO\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R3UXByHDknUmpBJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2UuXk0iMEp7Udli\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BIMUnMrQ1FDulx\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CHUup9xEInnRzA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ix4OGoSdsuwwRit\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"k69mVqQhBxYFMJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XSM1dKtN0BwzAp\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Dieser\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"teOLX7VK4MRSW\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ImaRFxibtxxB5G\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I7z4NfzEpALyPKJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blau\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5U3DvuA9IkLAzi\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uH\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"PU4LkVC\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json deleted file mode 100644 index f3cd8c88cc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FX8F3vOJJ7SRqLg7SG6YNYi1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ozZJncvGpl9v1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XeGT5FgMk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DFJU4opzthTfEBb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nTL6e0zOqQTCQfJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0gruX61pkNLbMw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0UPkINs8JR5Gq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G0y9w6syWVYjPI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LSSoq4QUbtmlpU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Rv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XEieEeHq8sn4Yt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"D9hghq0QfezaFQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UCSpfKGlQ2lJhn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ME1tHQfh66xna\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Pr6406zU6hpqs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M8gsCe1EknDFP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"mqqVdMa\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json deleted file mode 100644 index 21e3ab24d6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_QeMC5cHSdSm6OvZmdO5VEDSe\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8LwZhzmyBweoY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iKbyLzARq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"COt7cPLyuXUXvhl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y9JEUYvrzovgvzf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tXWiTJ99Fsurwx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7JWREvSLDE2QJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oPBdfCj7t1hlcM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"60ni2PMFBZoNFF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dBfEYrHDdWJMxT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q9ecv6Jy6f3Kjj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fW8lQCuxxioeIs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T6qJSuiwBv8QT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"80yp6gWstnNMM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"50\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rI66E8NyZMemIb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"ZdQ7W57\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json deleted file mode 100644 index c4943d3066..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_I8X3XyHeACbbWFHMVPo5NKbd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OcUJOnd2eMMFg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aBt6O6bTd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7h88vOmi0ck1gwn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6BH078OAiiGYuNB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ao0mHEdBgn8bEV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EpLKMRfpIhpuj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kNTbY8yAv8kUFw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RWoAJ9Kq1Q9wZY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"71\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0YnLKvzQH515iz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1dC5RVYbHNKkel\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vjKCUVUNhRbukK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"md\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qerEYvTmmKa6Hu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"mkOPEf3\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json deleted file mode 100644 index c8e5ea7084..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_NkGQuqJJTAZzmEou4hSP8XNC\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uSNQssiN8nV2c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a1KEwOqhr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qqjo7tzkWDqKxsK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sa71VO0RcP1NRIX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t5BkKzWBzYR9ik\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iGLQjkZcwx2rM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MlpLaSNlnD3CLX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8m7UCZAdxeo4dX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Xr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AMYIh5OkBovIkh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MrvLGGoiNrxdaD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HUh6MUTEJ7jqIy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Hc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JYF7IhzoKqODMd8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9BSv8P7pbhNEVd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YEBjrxFXAp0EuuR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1rqncc0whb8Osz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FnbmBqltF0IFx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P0LQyJysZrv1dO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OPK1VYhWGTr8Cz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Mi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2NUnQcsFW0hO7E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pDOQr09zWoFP9Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iqKA0rONNHOyS7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oGEVNGMbaiUMRfu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Cy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"RVyOHdF\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json deleted file mode 100644 index f7aca20f1e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1fEyQxasv2c9DWQHitDL7VTP\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UDaSt0CDMPd0n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E9dQT39Cu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZcUtz5siylQBgui\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YSUk2W61M5OPneu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S5eLRnAyHjiFIv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Sb0Ve0UvycC5p\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uGrNSbmOWpztzI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tob3xJQ11GdLtp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ic\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lk4h6wRZxI8Sti\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QBHZDbuemPfhlZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zFNOZWuIcwpwPY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pyF6OpsfvKIpK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6vs4XmjhDsYliP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7uUCIdsMIdeGh2t\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hm9wdVXHH96Lf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pvm15WaU33Oq3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vQZ30QZjLQb6rq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eDijIHKhNOu1A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aBtxNSxZoEKNx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ef\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"2ikqZct\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json deleted file mode 100644 index 32cf576420..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_9IS4X2ILIuA0OexNjzpCkqrq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"H7Bg5i0iuFAsC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"v4J6bzBmx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LSe2xYehbUoVnQJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wOOk31PNbzo0mZT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z3cJhq0P2xMJF8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lucEi5NjBJRMN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rxuHnnLoformOh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cUiCEaOrTbvQPk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5tUcHJN7nErO4R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"stniZm1RqjojGN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aFzcBHwO0iHHpa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gP0VSeXQJeLOn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CkvI7tOP2f0uab\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bKKIqa55KAIAOAc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3pDW9Xj0ww7ap\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wh4yIBEV9zn80\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"25\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lInYNNt60eaq1T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dZ4zWKyIdRJr9H\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"91iHGL7SlDRsp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"LKvmIJ3\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json deleted file mode 100644 index f7346c416d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_se5rp5yejE8clnmlOYLxu5ZJ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Gl7rQX84zf9gt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8UnjCIheL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"847uO6Yr6YqFLrZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"njQ22KYiSEYbBEy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l1K46z0lOL1nNx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Vxu8svaSCcw1r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LBzrb7lLgAsjNN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DWeFqGnO3755PR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2P\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q347ifn9nBvoBi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Jgc9iBMeNYCrUO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9QI1T8d4CuEFzi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Op\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e7SeT9AcSDQ1W\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F9c4KbGlyZL9z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"10AbOYh\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json deleted file mode 100644 index bf14bfba37..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "data: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_fldYHlxOFXI0Yk2jVisADgU8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a4UPP97xrxcYk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T6t6D1sbZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PAoE6w60bAXV6GV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EaNnwm19vNkHMd9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JSHT4x4kTeRxXS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eBE6STPQDGRYy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"00MTxxsAPuL965\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gWBCLg1Syj1zal\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ks\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Bt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N8ZEWCWWWG9R27\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8bqMDTNJEuDGVV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w1N4DrB3rOFJBt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Gp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ks1fgxRYPUnD3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MHTdxZLr8qwpQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"NQyI45O\"}\n\ndata: [DONE]\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json deleted file mode 100644 index 2c893bf088..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ce3471aa159401d181a031a94f536a6f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_06c09a347fad78690068cad89ca6d48195977d2f166e2b34a8\",\n \"object\": \"response\",\n \"created_at\": 1758124188,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06c09a347fad78690068cad89d338c8195b83e27e02faea2e5\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 705,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 739\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json new file mode 100644 index 0000000000..985093c7d6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29cab5e081939cec1ee9dd1d1eba0d9703ef6e223eb0\",\n \"object\": \"response\",\n \"created_at\": 1758144970,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29cb8ae88193bd3f9fb37cc215e30d9703ef6e223eb0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 733,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 767\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json new file mode 100644 index 0000000000..39973511b8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb2a5b82288190b6cfc3b1717f0a0f0981e1bfd7a1a04d\",\n \"object\": \"response\",\n \"created_at\": 1758145115,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5c106c8190ad2f9122dfa6eddd0981e1bfd7a1a04d\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 727,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 759\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json deleted file mode 100644 index 91efd08ed6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a013185ff454fa613135a1d2aae8e0cd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0c48a09e55794f0d0068cad89ab9bc8190b499857f6581cd4b\",\n \"object\": \"response\",\n \"created_at\": 1758124186,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0c48a09e55794f0d0068cad89b8ae48190a6b8dd99b4e3770e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 699,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 731\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json new file mode 100644 index 0000000000..fc69669718 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb2a5cdc548193a4a9efe4f3b945800c3e1a458a3bf5d1\",\n \"object\": \"response\",\n \"created_at\": 1758145116,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5d5cb88193abbfe00121dcf0560c3e1a458a3bf5d1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 592,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 619\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json deleted file mode 100644 index 3637958b92..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_ee6053865d15c053ac6b94f0cf5ffd17.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_08c893cb5be25c9a0068cad8a047788193a7030c492c152c9e\",\n \"object\": \"response\",\n \"created_at\": 1758124192,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08c893cb5be25c9a0068cad8a1aab48193aba5842ea9dfc5f3\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 590,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 617\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json deleted file mode 100644 index f3bee55fae..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_cf634699b3239ed229f0b69543118654.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_06f47b9cc91eb8f40068cad8a2971c81938b542d3e9f37abdf\",\n \"object\": \"response\",\n \"created_at\": 1758124194,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06f47b9cc91eb8f40068cad8a36a3c8193baedab76879295e0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 592,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 620\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json new file mode 100644 index 0000000000..3122050c6e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb2a5e24148196aef5cb3344bbc17f0e5c6795e82ea43a\",\n \"object\": \"response\",\n \"created_at\": 1758145118,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5eb3948196bdc051d9388065af0e5c6795e82ea43a\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 594,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 622\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json deleted file mode 100644 index d3e7eb5aff..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7b34734780def271970ecaef1786138c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0eb03b8244e623210068cad89617d48196a10307c7f1caac8f\",\n \"object\": \"response\",\n \"created_at\": 1758124182,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0eb03b8244e623210068cad8970568819681f0d869b96b2ddf\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 697,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 744\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json new file mode 100644 index 0000000000..9083f1ca97 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29c2b5bc8195bcd807e17fcf6e68071a9e8e68b8354e\",\n \"object\": \"response\",\n \"created_at\": 1758144962,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c341cc8195982515005f5123a4071a9e8e68b8354e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 725,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 772\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json new file mode 100644 index 0000000000..ba7659b46c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29b2b3108196bb0a60aa1ed667a40b067427e926029e\",\n \"object\": \"response\",\n \"created_at\": 1758144946,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b338a081969aa0869ecd91743f0b067427e926029e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 744\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json deleted file mode 100644 index bb1654f5ab..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_e447a0275121e64f7e8970883902c014.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0f507a41bf381a470068cad882ae948196aa61d3f12743f40f\",\n \"object\": \"response\",\n \"created_at\": 1758124162,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0f507a41bf381a470068cad8831fd08196b6b383a085ec9593\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 716\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json new file mode 100644 index 0000000000..1dbde87586 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29bcf38c81949a15a9265c71539f01d21bbc3bddf059\",\n \"object\": \"response\",\n \"created_at\": 1758144957,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bd97388194ac28283f42ad29aa01d21bbc3bddf059\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 718,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 93,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 811\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json deleted file mode 100644 index c4ebd65a34..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_a8a9a847cc8f56ae71bab8677082b908.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_02344721644696360068cad88ce600819096c9dde6ae427e19\",\n \"object\": \"response\",\n \"created_at\": 1758124172,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_02344721644696360068cad88d7e288190abccfdbc6eff88fb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 690,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 67,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 757\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json deleted file mode 100644 index 3d9da486bb..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_606370cd230fb0aa57852541e2826c16.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_049ec82e4f4af4ee0068cadd62aa288195ba75165ebc230496\",\n \"object\": \"response\",\n \"created_at\": 1758125410,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_049ec82e4f4af4ee0068cadd63774481959f94431ba96a0043\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 706,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 756\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json new file mode 100644 index 0000000000..4111b661ee --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29bf042081949325160705f12ec605b0ea34b55f3261\",\n \"object\": \"response\",\n \"created_at\": 1758144959,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bf741c819487c2fcfe83042fc805b0ea34b55f3261\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 734,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 76,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 810\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json deleted file mode 100644 index 3d534417ef..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_02ee54eac49ee27796690079ae102928.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0dda6775b6f8ed8a0068cad88928488197bd7321ee04c1aa7d\",\n \"object\": \"response\",\n \"created_at\": 1758124169,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0dda6775b6f8ed8a0068cad889cf34819789ab3a58abc6c98a\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 696,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 724\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json new file mode 100644 index 0000000000..6afc5df0c2 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29b9ab388195a83f904294cedd5d07bc9a75725158b2\",\n \"object\": \"response\",\n \"created_at\": 1758144953,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29ba35dc8195ae91d3b02c6718bd07bc9a75725158b2\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 724,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 752\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json deleted file mode 100644 index bd459e0af8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_035d43dfaa92e2f4ef8c2c0ef15dccda.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0ce242f49a1248290068cad898f5448197a020be19df99072c\",\n \"object\": \"response\",\n \"created_at\": 1758124185,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0ce242f49a1248290068cad899883081979ab6b2839448e525\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 72,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 760\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json new file mode 100644 index 0000000000..ae25994efc --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb2a6370708196b30294125deba9a30e0f83c0e96635b7\",\n \"object\": \"response\",\n \"created_at\": 1758145123,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a641c508196bc43cbc73b4767c80e0f83c0e96635b7\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 98,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 814\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json deleted file mode 100644 index a61e3fd0dc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_08ae00872a9f2c6f8b2a5e12758444bd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_03298117791523fc0068cad88ab83c81979abb7d6b6c375683\",\n \"object\": \"response\",\n \"created_at\": 1758124170,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_03298117791523fc0068cad88b4c308197975fc7467b4f1d63\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 698,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 73,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 771\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json new file mode 100644 index 0000000000..818fe9cd1f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29baebb08197bf120aa81fce172d087a202655f4921b\",\n \"object\": \"response\",\n \"created_at\": 1758144954,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bb97d88197b3d36427fb8a1c28087a202655f4921b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 725,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 99,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 824\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json new file mode 100644 index 0000000000..50cba62020 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29c1ac6481968d248eea1e2f7c5b06d0e29660bb2804\",\n \"object\": \"response\",\n \"created_at\": 1758144961,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c226d48196b0cd9708a443f94606d0e29660bb2804\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 714,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 745\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json deleted file mode 100644 index 6dc8df33d8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_c158abbfeb39cd0079a2e558305693dd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0ff24b469357d37b0068cad893af6881978523dd3edb601d5c\",\n \"object\": \"response\",\n \"created_at\": 1758124179,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0ff24b469357d37b0068cad894db6c8197be8b164c3cce4633\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 686,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 717\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json deleted file mode 100644 index 52f3395dc4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_9102cbc1c53c062212b17b10050f9b05.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0316ac59e8c96c4c0068cad891c79c819398832b9905c08ce2\",\n \"object\": \"response\",\n \"created_at\": 1758124177,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0316ac59e8c96c4c0068cad892e488819383c1a6e1ecca46cb\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 693,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 725\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json new file mode 100644 index 0000000000..dd2ba2b5a8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29c05db8819698cc4f48d8bd9a4302d2ed0675b768a7\",\n \"object\": \"response\",\n \"created_at\": 1758144960,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c101548196bfa4343cda6427b402d2ed0675b768a7\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 721,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 753\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json deleted file mode 100644 index cfe58f1e9a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_1479fba33d2f5126867fd3a9d73e37f4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_08aa32ed72bd7d390068cad883c948819481a72e25e21e1820\",\n \"object\": \"response\",\n \"created_at\": 1758124163,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08aa32ed72bd7d390068cad884af448194a1fa1cb6afe37b87\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 526,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 552\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json new file mode 100644 index 0000000000..243bf67981 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29b403948195931d82adf77add5c0214698ad0945911\",\n \"object\": \"response\",\n \"created_at\": 1758144948,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b50d448195b249e418d25c1c5b0214698ad0945911\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 554,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 580\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json new file mode 100644 index 0000000000..dd272a68a9 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29cca6288194a1c043a7607c97fb0d9ee3a2554867db\",\n \"object\": \"response\",\n \"created_at\": 1758144972,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29cd15fc81948387f8f24f10abd90d9ee3a2554867db\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 474,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 530\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json deleted file mode 100644 index e8573721ff..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_d5cefdf40285a9390452e873ce6cf64d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_08c1f3a3049c36af0068cad89e447c8194992f2d725fc985b2\",\n \"object\": \"response\",\n \"created_at\": 1758124190,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_08c1f3a3049c36af0068cad89f2be881948f746f206562aa48\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 472,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 528\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json deleted file mode 100644 index a6f68730d4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_897a33c5523c928b3293cbff3b4b61b4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_0bc74b446ffc0b110068cad8878b788197952b8c84ecf4739b\",\n \"object\": \"response\",\n \"created_at\": 1758124167,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_0bc74b446ffc0b110068cad8883fa08197898d468e5e94655b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 699,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 730\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json new file mode 100644 index 0000000000..47f91394ad --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb29b7c12c8195a315a4f857d201d60a2a2d78ef35e812\",\n \"object\": \"response\",\n \"created_at\": 1758144951,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b835c0819590204df98c2a62190a2a2d78ef35e812\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 727,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 758\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json deleted file mode 100644 index 041f19cca7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_9f0d14a9822c996470cda6abb86cd593.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_06845d3ec8ade7750068cad88643a481978d0262549c3301c4\",\n \"object\": \"response\",\n \"created_at\": 1758124166,\n \"status\": \"completed\",\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_06845d3ec8ade7750068cad886c2988197a7f85996014a6ad9\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 688,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 717\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json new file mode 100644 index 0000000000..d1d28a3d46 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "{\n \"id\": \"resp_68cb2a581fc88196932a38c8dab2d7420b16e74082f53628\",\n \"object\": \"response\",\n \"created_at\": 1758145112,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a589d288196a8811acd2e12f29b0b16e74082f53628\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 745\n },\n \"user\": null,\n \"metadata\": {}\n}", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json new file mode 100644 index 0000000000..aa5ff5481a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"DwvIaRDfQOpKhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"4bPQct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZtfaY0u49QM7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5C4EL4RPndfN98\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mTivB3MKQVFI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ddfp0hWZeMDkn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AFIUBSherD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7HJGRMHtmqrUH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ThLhXQrTshlVYH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yNRhVat0GxCDG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bYs9dzdRShVBI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"co5zt4iZLoGC6Rr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"yZhjDlZdj9Yt6vE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"kWbtxnJmv8EGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"EmEn2Sss80l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JSDgvZY6TVeVj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uVyKOuZuutUHZSU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"zHS9nVl6ZjVTkUW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yvbFbVct3Cw1vxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"9vzaekWIUNsUtU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Ez0L6JoXPX3aljv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"a49BqiNZvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"X7ts9aWBIDvVfQd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"95rEYjLbeLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"O7K53tN5tufo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"9Yg0QoQKMhX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"CpGjYvtlwZ1wqfz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"r45dXnym3CI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"LQ7D41N4AYRXOTX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"p5lI9aBsLxygui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"llGsnH4xL2Wckm\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json deleted file mode 100644 index ceab078b14..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9c740a830526aae5c1681140dbffce61.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"r1Gvgh1LiG5C0r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yEaIlQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"XkE2QIygifvId\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EMm2OItdxeB21R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1XxymyruxEoY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"y9ILS1TpuiEoM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BSI0SWoF1T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LvTtfdd0tvoLU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UzvfsdkDiTDTUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hC2z3FMEKzQy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KFXeypGlb7zr5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"RtRACwgXmUxdWTb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"AWwfQj77nsHNDwJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WhAO5HkP1Tic7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"lKM5YPkUENs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Hwpk9nOwyU31Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OKRmDTMIptjCM1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LESIp9Kqk0z4CIt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2A82JIcCyExcHbJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"gDJMEnuw2qsXST\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6N5oUUoO5Q8BXeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ub2u2WXJPC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"191qmlofL3EnAw6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"sfQjI2H4bdB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"mpmQueXOFGcD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"vb5bs7UXimd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"4FgQlhx3YV47duG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"IqJIvWPqrNH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"NOxuXufR9dHz9mp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gv7IquQIwO1XT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GwdUW4z60F1HJT\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_00e33b50ec5a4d440068cad8f24e2081938a8322e1ddc4ba74\",\"object\":\"response\",\"created_at\":1758124274,\"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_00e33b50ec5a4d440068cad8f341788193acb2c852cdf194e9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hi, world! Bold the text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":705,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":739},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json deleted file mode 100644 index 40405c0e8e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_9d2ea9b77f66167634b2565bccc1fcd3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"xde7UUO9vZJN0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"UCqt8z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"eiHQgmi21tgbf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"19j1yrTban5xdv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"G3R13HbrVLz0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VSRqGNh1mRmCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"2TFKZzR5El\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YgYRAH9hkG3Z5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"EImzPzXBquMY9a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"lF1owcjNQ3Nnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9lJwjRmjykLec\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YTYLjaYQMRZBuyd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"SQBCy6Z1gJyXTNY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vWgIvoR83SRJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"huEyBuCrk3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jr5ppyaoetwvJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"na1F1CGZFKjVg1n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"KmNnTRpnJKcTU5U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"10RfQpZf0i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Gtc7ruci23itM7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"c9eppzAKGL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"wZK7MeV6vc6vL1d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"gWEYMKKMZgq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"aSarmqQSdOV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"AV3BV6gKC6jbPgt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"Rjfc97nwD7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"EW3vpFSrtvqGwxu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AtjbTjo09U9Olo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8ltUfVJwhzuvWL\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_011251b432b55fe30068cad8f09a0c8196a3e63ad496472608\",\"object\":\"response\",\"created_at\":1758124272,\"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_011251b432b55fe30068cad8f14c8c8196b3a465f1ba94a506\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":699,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":731},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json new file mode 100644 index 0000000000..115259da52 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nnKMw4KxnC5qWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AztjNl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"l0SrVyQoXMRW6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BeYm5X1q4rWxRJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"I6BZlRAEl7Sx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SejvsQm6k0KEV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RmbD7kglZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PROFY1XvZqIIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ha4eKhsEIk013I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6TG6U8YfooOL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"X7q8hIrPjUt4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YK8gmipCSjLpBoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"CXfEqDl631ojE7L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UOtjU1sjw2FjA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"cdohq2VmrcT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uPCHNCKc9zs1G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ISw6Es0Ksb9ltie\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yxM7QQNtxO40qKU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"Ys9ZOXVBje\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"63OYS133Z3pSmFz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ygKzjANnbj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"FvJLHGyRmHGR5BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"joN39TCLOhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"wA3H1Ut8OSl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"1W1Uqq5zDxFDAjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"gVCB0C9bsRQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6SrbJOMblg87wRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"r2vjAJmfiWjqLc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"aoDLSY6PgydRuy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":727,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json new file mode 100644 index 0000000000..f926fe449c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"wIqCS7o26IYSTI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"YLUlVe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"2AnhWLSCb9dpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HrJZiHf6eJZAVE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oG5PfrdXiTP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uIQLWq82FlAPW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"rZXccuez17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"14vAD2asYzVQz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UcTsD3ELU9pTC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VwXvguWPSREhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"awg6bib1muKcx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"G6PHFgDlxlOdJK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aOcbQx0UGVcpJQ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XVXfh1x0u77g4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"pbHtgvOMq1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Etis9kzeMjYYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"u1n06gwflCag28U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XA2pRCPlkAwoKFV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"ehUNQmmmj3XZOa2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"UXiitx4205aZG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"HyNTAd1epzPWm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"vn4iM3B7IqHYbDv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"izD9UdAbOXWITY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"qshwZSO81vLj7i\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":592,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":619},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json deleted file mode 100644 index db3c7473ae..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_7dc2cd1e78b7b70dcfb86fbbdd79498f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8JO0vsudLsn3xQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oqMtz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SKDyAWVqoxpp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"1L7RStmKtSr3bQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"6Iw3iLR9g6gw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YupYsx0ZJ1aMa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5qdJEWKpo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"mGogWBpgESnTz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"v7EExHmtd1OajF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"miXIWYNorB5D0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"EQdBwNrcROpal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"zITST6BhaxT9Ugd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"bHKCX02JxyvuGza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"B668oUWAbdLuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ZJ8qq7AkJRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"z3wOmrqRlFgRZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"KspIWknwkVhrvxI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"iWfPSZFt1cqdCvH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nAz3Mtd6lPbIMgS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"CWYWQMvTUPa9e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"KxV4ME2ejqGEE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Zz1niin6bIon1UN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"hQ1i5HSIR452jL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"1kvKo6AUQl840r\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_0aa2401a8dc4600d0068cad86e2a688190b122f597d388ea08\",\"object\":\"response\",\"created_at\":1758124142,\"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_0aa2401a8dc4600d0068cad86eecb08190b74f2566cbb86c74\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

APPLES

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":590,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":617},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json new file mode 100644 index 0000000000..f75b7a4132 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"l6yHTNqbWebKD5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"uLuyi3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ugP9e35Y1oMPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GLcZW67pYdJR43\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"F1O7aTe0kooA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3JXCieAnaETb3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IQQuJZqHCy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TPLlYYQrVR8QL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ebA1xEQnB76O9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Us1omvVRjSntR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Amj216AgOUBsz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1jrohGtebXNG0qE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"6BchjSac3AVzyTj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"onkC1eFyMTrZI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KczwHV4VFou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NBGG68F3uJSkh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1AGfeDHJEcVhOvm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"zfrkJJ3hJV2mhAz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"F8UF5ij6kJfGqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"KFWApg98rCp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"CnHRbEMsLnQ0Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"weDMywXIybH5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"vOq5zmWVywzLKUf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ybKSnW2mZzxhMO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"yKphGHnBeOSoet\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":594,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":622},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json deleted file mode 100644 index f64ab45c9d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_13fbb3be256ec82e826b622cdcae5247.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3GeXnhZLrPbqxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AwGbpp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Ort6dnXhsiidn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Ot5bWSwy5TJX4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TVeOU026CgO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CZeckvhhvnFwZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"MFqdg1ttFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"H8AQdwUAfhwli\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"jIhxKQdcXFXp60\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZxM5W93K4J2vw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"h6FiOzKW7CsQ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sJejhRukl6L8aLT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NeO0oFDa4H11Jg5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Za6iqC5MDA0YN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"hC19GKbtHBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KAKlewK3vuDIw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"BweuJlN2QIQ9Sws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"okwpINAvAmHmS9w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"YOt1yW1TjV0CvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"4nWfFEt5cVc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"cCm8fI8Q0AHt0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"zPGo942ckImq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"h0ijzIrKNEgEam1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"YXTT5osSs03jgk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"NlGaTHwZ9MpdlY\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_0f921549c1e69fa10068cad870a0bc8193adf95b900ad175d3\",\"object\":\"response\",\"created_at\":1758124144,\"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_0f921549c1e69fa10068cad872126c8193ad111f21ea2ca30a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

I NEED TO BUY:

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":592,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":620},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json new file mode 100644 index 0000000000..223a31f6d8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tUBMB30pmq6Gvp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sGLTOo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"lSBgVUqbzgLz2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"p525VKHApFoRp6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"VdFD1Ra54ANS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5IaceQKHR8ING\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"q4pvbeVkHu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"tG3exnyBuMms1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"93EKBec8eT3tgp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DYzpbutGZZRWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwUJNR2r2wnce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"hITenuNKz5IDr2w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QOjQhVMkhm2ayIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cbwIQOiqi2MOv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"aGeNXLhi8X1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BuZn8j2o7KOet\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Ek0g5TGflNgSitS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"PqdfmP9NxhBJGRp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"xJX6lltIPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"wXa6tYQhMY9ZMIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZFW6T9wbbPrGFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"4MXFZfFD3sJI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"aVomJc0RcBh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"McWPLxlst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"yrXmLLHY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"oiIxYQF1105\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"SjvCP2acY3PQr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"N5alxJaUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"meKuKJiPoatLK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"hkalgg9WYlu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"DrQimyzzf9B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q3R80ruwVHBGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"cGSE4zZZGdIp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"KDNTRqkSdNoL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"smPr91rrgeFIn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"9f8Zx5o3p4Jf7no\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"MJ2ZY7vK9HJw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"276CCxdBSSyM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"D2r4nYPTbtNn9gQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"b5WviygRS24mBll\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"CFIOYgiEMg2hA7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"YsZTHiPGp6ZFWR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":772},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json deleted file mode 100644 index 0a71506e9d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_9ac28fa826d75634499518503f07c102.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nMYVWOypjZGnz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Xw8m55\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"oKNxAHUQMC7iY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XCcsOIcjMisHRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pzZdJi0bRJXZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7u3iQZNdcd00G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"42CEZAOU1R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ivkP41rORQvaM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"kHV7irh9qjiX0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kpmMYsW73hlit\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"UQHsrjkf99gHM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1uiBlLzHAj88uXD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"bcJmpNpCYlDGCpo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bQRIPWvl25xg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zO2bkw9GcnL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EndMmb1vN6OcF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"2ahYBRreIiSC27p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"w1eUYnFC0YQsK6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"UEEhukOhBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"LXAvUfqeIVKjPgJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"wg9W1okUvaoQ3s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"vlg2vYk6bmdV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"shFKQleO6jW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"bhEZFHTYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"AekywbnM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"dikIQKITuje\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KvT6QnxTpe30G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"J9V3CoLdE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"vNrD0tJsUXdmrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"PWvd6CJP3oG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"xgnbQq5qLb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bhSMYF8iYOO4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"btqVMZFxe1HF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"OgewcCCaqIgh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"CRi5dr4ubEfxm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"Nsk8MMNvJh5zEKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"QyGNa7pM4TqF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"GWAqdEq78ZB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"qZtd2CvABuH0vno\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"T73ofShW8aukXkC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"q6qiHEzVbp486K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"MsIzM6Z2GitINK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_09fec9afdf4a133f0068cad865ab7881979160ed21f122bcb0\",\"object\":\"response\",\"created_at\":1758124133,\"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_09fec9afdf4a133f0068cad86647bc819789c52b6bb2591a4b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":697,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":744},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json deleted file mode 100644 index e5c9063f07..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_896f5d4e6e06b37d71e5b24ccff257b7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HLt92VMu7Usmua\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"GSLfUe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"NtLlNHiijAKMA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"imwFQCZZWEkF5H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"S5wbVCGyKyLM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tmG3RRQ13cRFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"sgCiUsV5y7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XblWlBhhUUM0g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"5vgbrPkGhAIH5F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"F1BgNyCubeJ70\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"cUi3zH3T7CZxB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"HvKujI8cyfSQYN4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"CfVBUpkJxfZrAfF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ut9nHYK55Ap7O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"GwNeoLjC5Vt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"27PcdsoIVLvTQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pHAND1CLYQPd2Xn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WykB7XQW0W6BoeA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tgpkVHBYcM7jDgg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"DOt4kIgCRDO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"PhiIb2SPedVkxj2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"TzS8IZHwwa3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xCbpTLc8vCSBAhI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"SZthpkShqyqKCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nrCC4f3v8OsXyx\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_03091ee8ee0e5cb00068cad55e75788197982d674f59116b9e\",\"object\":\"response\",\"created_at\":1758123358,\"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_03091ee8ee0e5cb00068cad55f09b48197b7ab35d7544d8ea0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":716},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json new file mode 100644 index 0000000000..05f2e23612 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TwL28ZXUErJxh4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"RVvvf9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"hoMlsj7n6qQ8m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"outSnuCR0VhKaH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"XJZu0SiYPLYU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PdlUoyue6rZKo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0YW6fJwKwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Z4Iqr6CLWrAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"cWpgSNQNdAJHzR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Dq9Jx2CcriHJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"55PrdjU6d1AT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"0zQLrzLw8plfEce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5ErMCWu6iM5Wi4Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PelZKRhxPBW72\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"meG7jK6tGOW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QXRfwMGzk0wYQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"qTBMN1tIxalUaUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"z8UW7NKKO9nKOYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"bGe18qFVCnrYi07\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"tifwLHdcQE3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"levIVVQB4idpfIQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"yLL290ldegq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"acnWEDO4xxad3z6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"X3BTvrznUHtWKJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OuHBRXDvXHsgkU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hallo, Welt!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":744},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json deleted file mode 100644 index 511a6472e3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_765368819c77871f23a56edfe3041c90.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"PswrYIXTsdDrgl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"z6SoWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"oi2cCABRt4bEB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfhp03IhoUhy3r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0OVOAGt3djcr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"evXstxEFInsQu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Upk29P8EdU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Rvy3T1pxvQqQ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WLPOP7T5gJHFrW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SaLfBtNjHvplZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tqZW1wUANfJ5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"0uks9TZuprTbHBI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UlFfyerE1CakLLT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fTybXUMxOx46z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"WciwVb639ow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1zIrgaU7j4Qt3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3N54jSXoAqdqZ8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WF6YD5h0PgVmOtV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"tDbtgbQkMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"tLHSLk6pS3nNVdA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"yJZfclpE7pjvrB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"1RxlrTMGzKld\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xdFru8qJRGC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"a9h2FhcyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"dYTAhGNE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Nj7IsZWtYCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OyhHIOiqAkKp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"jsdiRcrRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fI6jkeK1S9HW4L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"3K4dDv3ncow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"IjSTCTYaCjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"GwQCZ6TTxlDxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"qC9DVZA5l4Dk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"I9pYuQrE8apY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"QbEH6dxx55FYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"aKiqG0dwFtcH8rL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"vKIqpdHFxJix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"FLkkrhvMxhiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GGpdIJRrqYQvUu9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"cUWnXtShS5vfNWA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"piiv5lfVfVbs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"NqobslFgfRbj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"thrHL8RyJkAO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"yeiDod8PTB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"9xPkh08XOSWatC5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"uVDCqxh8EQNrcO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"OKLaXSHA3syl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"djbPshnsf0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"A6tJtf9Miqw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"Unw2rpfV4Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"7qq78BUZdS9Wx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"yBYK9mcFPHnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2nruwqhiLDbYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"ULFqoNpNkcZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"4uFeU8tYWii\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"hfSohGKwOuE4o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"Ppwu91tOJMK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GN3lWgM4KkCTNu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XI8quclAELXwye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"zls04QV66oVECw\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":70,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":71,\"item_id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":72,\"output_index\":0,\"item\":{\"id\":\"msg_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":73,\"response\":{\"id\":\"resp_09014c30d6c5b7690068cad85b27b481938ac2672dc4862fe1\",\"object\":\"response\",\"created_at\":1758124123,\"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_09014c30d6c5b7690068cad85be59081938156096c7fb6bb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":690,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":67,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":757},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json new file mode 100644 index 0000000000..092ec1b36e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"O95DHgod1Ev6iU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pzgTQQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wtk2BcyV9i4dw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ppoUPDJWRppIE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"fRaSMBFJSPdn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pNdnU9dzK6SES\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9Tmf1KOQqg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YrUsrv6CI38GU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0YhF2QkmCnX6Ik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rqbZnxksLv07F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"s3fYQX2FWvLDI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ButZMVhwPkoI0gn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"KSbSzk36EXoM45a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rTFIH70eIWe57\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"du8dVoRV8oB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PiClE2NYSlNZV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rlHGlOdxCnopbZn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xJ9n0YkmRaDpx6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"IpbfFV3jX2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"1aJZMGtjAUDMxkF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"szTTNHoUzA7VpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"XQdONVqCPI4t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"n21Yyz0vPYT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"5hQaE0rft\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"fq5cxVrq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"vja5F3qXyk4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DlASwTNWU2HIE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"JrVaTjc8Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kpB3PWZeOsFAUg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JmUXjowrgzd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"9NVc0iwVHSO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"MQSk5dq8VhmtY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"r2E2w7lhgVZN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Bfil22UzuoH0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"7kBafDUUBD8MO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"VDVew84x6ndkGjd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"fSMI1Js3bn8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"zcBgx5wvmGcK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"CzfMfhBVOTAIimh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"q8YM98H6ZjOkfq7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"jmFZvybTNDb3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"jlIRA8a4WnLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"fcWoUWKWHjvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"eqnqN9d3pI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"0bwfLMTe8JUhy5U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZEqJJGvRBMjZEH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"zPNqkMMTB7oP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6DHJfUcNAJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zPNaiW7Gt1oC1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"oYIlVFvdsy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"nQ63oFQhSAHSr4I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"bvgxgAU1KKdJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"7FQ4euqOcAC6Uzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"diYv0XvBdVSGzz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"e3iO2m96ygPZwJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"tlrvaGPkVvkzjoQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"yNLCJHGiuMNVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"PyVHHyY71Jvwwoh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"Ghzpor5pwYn2dFe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Rc6HaM0IGkJMY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"BO61MXNphMNz1d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eRZyHyFLusPzw9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"8CTW44tDGRR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"FzVpE5zTKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"xz1St0qVhMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"D0zAWcPvoMCal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"xYHdEL6y4Hcf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"lrqBtx03nv0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"0FDkLsXlIKjSoQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"vqOHV1sIu8Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ozZ59QVCwC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KUF36Qx5e1q9w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"x1SIQII5qpbq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"M27NmxqqcALm58\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ARkd97UcRzt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"9SCnjHe06ER\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"bqjA5ARCOwEb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KHZ2taz2YvjGA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"GO8lHGHC90WoU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"MsqTxAJZi7DO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"u9wfN9zgCSl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"frbcA3LedwBnR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"mAFqLQZug2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"raSauXo5ugu6XZu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"raQLMpgY6EpAKy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"1DHtuAF1srz0kq\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":718,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":811},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json deleted file mode 100644 index 1b98299fbc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_143aabdf8ac21ed460c808ebc490c41d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"e4J1nu7JY6VWH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"ezurb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Nzid1jAObdAxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EbbEM6KYMeczx9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"sgrgkCyxoGLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"AxBIGNBvdYIPI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"n6XDTWh3on\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DgkhsUggXPBUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"YCAyqm5WPchU5k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mpeXEAjVUBswJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"UOE3JD0zobkAE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Wqk9oPLNz9DWttY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JJmb3d9L3cQnXUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1J4T4FmEY8JKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"rqMuTqLjwVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"T9xJdYjr6xvDz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"frczqurxvNZEDVd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bY5FiPrKDoHf4bd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"rLAQ1gmSM4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"TOgs9Gmkh89ZOoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"86tldXbMSYWAL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"yP126Me6hD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"tUoX7iPo7iFpAAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"43YHLHVhjTxpy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"4dCtT5vYVdNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"OfVsiU6LaN1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"Q6OyFZvNd0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"Qc8brPhWKLn9y8n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"6VKAJwbzjOXHUO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"jJInKuBHYxrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"qcdJae3WciF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"LGrnkEAGw2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"gayOEMOQBs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zq1mo1bbb2PUX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"sYn1xBXgbg2A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"C7c8n3BgFITL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"pIISirmBm96J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"SgQx46WutKb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"taoUarnaCq5MN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"9sHvXFbm0mV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xHGyz4Y99tE4sWO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"heJttVbNg9KkBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RRffWl5ZDQZMv6\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_01e474d7061769650068cad860327c8197891b0896693bbd0e\",\"object\":\"response\",\"created_at\":1758124128,\"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_01e474d7061769650068cad8607b24819797e42035b7481c01\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":706,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json new file mode 100644 index 0000000000..72a14bf038 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OJh8Gz5dcGBleR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"A8ii5f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MoOuK3PG3oFcN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QhTkAJwCazWC6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"4VQC6zDbruPQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"E273cMUyylwZ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"uYWA7ZILRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6kVy07cs20Pc4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"TPDgtZGmXpUkKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"C8dmQiBSkyUX1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JncRnwwUHh5TF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"frqujOetx3mWe9T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"B1OuNqDU5ee83XZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hOkar0RO0Q8Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SrXUBJ8RpUY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mDxtYMjGQWo6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QClqnnucEJfe9wj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dxNkvXS7hRhTYVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"nnYU2z99Bl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"rrGVPER2yZ55SyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"oj70xUQ9PF4YKM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"rPaeiqo7n9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"NPQlJCuzqCf7Dkt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"0dacSeb8NKoHb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"TNU6xgqeH8s2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"D10eTmbXHOcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"c8rlTWwZXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"hXhEDExsLTGGHmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Ewy92PXeaim7VU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"eHHLEiAbWQKu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"V6MKTxfWKg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Z4AQWhoOuS52w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"7ljavRf02mR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"iIYKNHT5hsGMjTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"oc68bxMv0vdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"PBzsuxEjOjZGMvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"7zZ4RVnXLNlTWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"xH5291ULDVkhIyk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"sWkn4ygtMcrk5pS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"aRTM26lyE9OO5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GBLZaHd1nhtz6B1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"AwZDdvZm6hsQtH0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"TwTmA9GwVBH2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"08b0iyhvvU5boJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"taGbr3p7PIYCrX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"QvjstpjMvII\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"7TkuOr3SBK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Wq5FHMEDHqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"A0aZdWojKHJ1D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"OWpLGICuF7cz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"hFzbWGCwYZS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rcXtKDahnxguJr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"7mTqUSjvkih\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"v8JedfmPJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5CGwBAl08XFea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"J49jyqHL2cwr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fH4k1mTbqf52Bn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"1QQtt6ePrcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"y8youtnbj5C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"UMtgU8cXSnhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"s1tCEmwGNlhd1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uNVEXM3oVfBhH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"hYPNuwjTS32t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"gBZ3Cf4d84x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"MFhUxFAzJbRR4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"FvyTiezoRhq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"zOhR71w1ihtmypJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"KLiONpK0p8x8Kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QZ3Yjs7Y60NxC1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":734,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":810},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json deleted file mode 100644 index f2fcd5d076..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_2d4c1e5b3b1498596445e7a3cb2c915c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I4aoQqmJr99z0k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"XhIHYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UTexR3OSg3ZbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XoiddNgCWrgJBC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bGeZ6u0RR7VO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MvLoaRy93qmqL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wqXyViL9va\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YnLUWDMzPLvEf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Qn6Uswxqvdgoes\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1T8MVsvT5EnNs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"g5YTmkhmkBDlt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"VUIcYUNpsOeMYJ5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"40NEbwYeNmHyWGs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ygQGCLdTMXszZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bZqBhX684NM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DMcVKTBKsiAhj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RWFJWJ0DyMoptBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Z3LFQz5MzKOzBna\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"MCMnGeqGqq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BUxieawawM94P1M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"kZSb0LJm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"r3iqkObp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"A0VWGfwsVOIrLtC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"pouAjR4f1ZsMSo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4xqIR6PQCtw8p3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_071142b860fcfba50068cad8567c988190ab4dc76f05f414b1\",\"object\":\"response\",\"created_at\":1758124119,\"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_071142b860fcfba50068cad858517c8190a18ff9286fac72a3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":696,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":724},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json new file mode 100644 index 0000000000..be168db23b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CHyN2vtFMprhb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pEmF2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dCwo23onKlMeo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GNDxMixexc8jHq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"EP5TnCPmqrPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UnVn0YR5cUaRc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"PZPCfjz4xF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"09ad6yu2BNYRG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"NdGR2U49AEE7JB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HWPHDtCAFGr2Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qWkAgjTwhgqPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"MmoXqWz0siorD0m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"KQ2LZrJdkbO7NJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qw6jKshJXgsHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"YpvjzfEmr2c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RfLW6STIrAXEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"vYrIp77yLNWzZe6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fxAtO08ROKX45rO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"cHO6wNDonu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KHZbfjNqJhqUXWG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"dRY6FvcA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"wsVHjg2p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dJ6NTJX6uhpGr3q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"UK5nc6D9RTeSGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"v3MdH3ewhA17d5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, updated content

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json deleted file mode 100644 index baf2f93585..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_b7b1415ef4b5afbd00eed961b84f2f2f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"7oT7O2Cr2TYFuP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIaI76\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dHHSf8M6itUqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZWTyFClxUY3GGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"7WU3oKdm7YWo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ndwIPny9sEUzL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0m6INvatrn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WcQh1TkNtI0EG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"QKI97IXJMACuk0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"exQwMmerYjVN9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O661T4ZVVj2lZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"qrAMrHFGTEFbDjK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"7TT9JSu0QZr2B0E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"lbEM1YPHqVozy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"tAhep5X0U2s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"AegYl7Ha6iDzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"s3RyN6utTI6iuW1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"7LU7PP196HlQGIx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"JI6KWJ6435\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9mJqUrc3RcryRj6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MJbG5UUuZ56ZRc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"FkQCXd02A8DH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"e6RMTkHl3he\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"xig9jvpkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"N3YtWbyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"aYzcZTk9v4G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KEBhW02ZXkDTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"tVQCatPD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VgsDEn2wM2pemG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NLYxRRWjI1L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"tfHyw4sF885\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"apyvNGSQhYwZf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"yVznJgrZjd9Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"0ou2vtak5jBC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"XBUBp2zCBLHd4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"NpluL9H0efc7ymw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"UAJOlwMXz4uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Os6kWs9Tqg4q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"MRe5sH3Z2sLUUse\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"v9C5ETD8OFxF6fj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"RhX9jPKNOLKxCd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"OGfew1l277\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"emsBXor4iEZMNd3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"uHuXQ81sF4QcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"xDXVPHCrzsJY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"phXVg4HDl2jH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"qAqJ7UH5AO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"bzPXZYdfku0aomN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"R5Rc5K6ooc16Ki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"E2qdyP2EPyPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"MCsJz9GClOX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"Wz47MA2A8mg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"VX2HJmGspR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ExYHLHZrp4cz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"JZPqx7j5TyRx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IIMKKt6DabICs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"gfyrNq1lPNJF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"OdOFslvzMMy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"WQW1lG9neoqnd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"9jlOAcIHD6Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KSOHyZ2NaKyzlRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"adlaPCCyiq3vuN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bkhX0hjh1CNsKw\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":75,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":76,\"item_id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":77,\"output_index\":0,\"item\":{\"id\":\"msg_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":78,\"response\":{\"id\":\"resp_08d789d4a58a70400068cad8678f308194b6d0c8e113bbca7e\",\"object\":\"response\",\"created_at\":1758124135,\"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_08d789d4a58a70400068cad86809fc8194a8ee64bf4b70c6d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":72,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json new file mode 100644 index 0000000000..1339919c6d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VDG3at3KM0NMro\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"A6dCcM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UmPwqRbEeprLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FzlU52PuiM13YJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Al9TTnJRxSpA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZVfpnHt57Sl30\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Zd0xHH3J29\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bYOnrMDmxkfvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"da7YaBAd4tOI7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yz32CBc70UmND\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"5J7WStBbsER8J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"XUoLfIsD13uIPn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fJpKGmfUpS9zRDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"02bcM2VYSACf4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"r30FkdmJuru\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UuwcOxWTbbU08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"jTAYxsRUJCu8jbD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"2CodWvZdA5I7Xyf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"q4oVpTxKcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6hNItCYAES27CkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3I3WxZRvgDgCgY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"l38JQYTD4Ymd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JDb5Nij7FK2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"pcFTKGOyr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7NluK00P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"XMZuPV0VlLE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"P5IGj03BP8kdh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"HltRTThml\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"6Z7zOqnzP6fZZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lwCTWB2HQjS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"pMFIjHIwpad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"K6IbjMQEk9vfC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"9b4hEF6B7NOQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"V0wzpDsLHjGX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"PxJ5LROFml3Ld\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"eF1HgCNrJrHfcpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"SEdq73BFb2WZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"6iyJ7sbhdMKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"4Qs8SiTfXsmEeYe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"70nGEUaHvj1bNXp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"OH2MyHA0awI26P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"3fqPdT6lQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"y6EUdMUNBNuCcIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"NPZYZFuG7T47q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"e9ygq0Pgozw9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"1dlxtg3cStbd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"tH9DiqMT92\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"cBw5HdDSPvvRESX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZrlIvkqTvKMS9L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"NggftW2ROd6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"kK1peYqROR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"dMsa83jwpknZ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"UzVS8LIonnY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"jqJ2ELmgRyBHg54\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"TBVlmSNRtPHr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"64143AZuB9GSkfh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"JWOv3eO1Vu6XYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KwN0qUaPbC8EPJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"VZxMdat69TBHuQL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"H57A1QMS9NmKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"AYzVjFX9weArwUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"R28kqfmXaAowaTU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"e5aZO4CG2lxcC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"L3X4EG8VptyG9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1CttpRhNOJ1iaQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"BEg0HvfATd5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"jeMs5fRWfz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"P1ZyTN4ZTNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gNDQQpXLlsifA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"TMvvvpyT7i7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"M8aR75PNa3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9DeK2GSS4wsElZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lRiczLXzAzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"uLoEUUmlTX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"0xUaErygByBdz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"xHcaLcUemxC1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bFqkDPvMAfaSCt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ZNbSlVxLxc8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"3xL7NpyKNeh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"MkNHsAA0V48S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"hdm2sQ170fhEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uBSh8V7Tt9cK3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"aW4m37XcK6JY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"T2k716CKzLs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"0MWUpwG5SvHRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"ig1DBZzhtJz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"6Lhjutgg6dwoMxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gl4PF974ZRxbvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"t9z5aE2Icn0yxV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @Jane Doe! How are you doing? This text is blue!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":814},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json deleted file mode 100644 index 987ffdbb76..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1c22626de0e444ba6765152158a82c06.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"d0ymnY2BPGEsNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"U9AFAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HE6FzdXWesbrz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lWUwh0plpGykUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0Zk97Q7IHOc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Glcmc5x5j3SJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"1CNfBfoHwX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ROwtD9EPiovaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"xb9sM1Ih5wut5I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"az2rqPjTgcMlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"eccO840CzgO7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tjOcaxyfNJxqAdT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"azJ4gbbtDdyWJqk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ip1eXsdvax1Dt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"5Bygy3Tnv0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gBKr45bG2xFky\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"YmOCXaD08KiGywY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dyLZLNOwqFtcfDe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"FfoSWvKMbqFUGbF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"fLOa3YV1KTy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"g2yWn4LzFek9kx7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"FobrWTZ7xM3Yek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"EbMHbQgRANr3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"huZ2J01sWiN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"P3Yib1Wur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"gnBWl4MY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"KWGAQe4o93s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"EQh8v0eD6JQz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"kiMCbGwH5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Egt9Qbxn2sbj2W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"zXrNQzafEIl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"3ufGytoHOwI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"b1tj1tdewlU3L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"BmPr5UbdDspW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"RokVauZPbKbu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"RjAZWbGP4ZVu5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"tnULDjPl3VddJ8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"cd1DuV0byIE5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"9Fh0rziWl5QV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"wHoXn8vtcgiD2GG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"9FruVW4Ulk4PAd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"HyDZt9Tclmz2ju\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"avN7xKtDgN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"f8yiGD04S6VvoWG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"dSuS8xbOJ0atC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"wAhVNtmFkuj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"JXwLuUcIOPwoI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"1NWpvvyWMTzM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"5UFcxhAok0miTyN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"xk79LBH770sgLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"dSnpQNHrw4q0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"hmkpKDppS7V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-text\",\"logprobs\":[],\"obfuscation\":\"CbEk5xv87K9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"-color\",\"logprobs\":[],\"obfuscation\":\"G46JLW9BUR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wzTrOd1zjWXq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"IW4CDdcrOKlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"NyAtl5mxDBPbf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"sTsYDwFYzs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"N0CfOYYzmcg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"LgR4bZBoVxZk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"7IIyv3D3DNX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"kJXwFMfoEsxJpqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"08VGfcZHRCAU10\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"x8aoOkEmctBtoO\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":76,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":77,\"item_id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":78,\"output_index\":0,\"item\":{\"id\":\"msg_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":79,\"response\":{\"id\":\"resp_056752929fab4ee60068cad85952fc81909fda3b40512f643e\",\"object\":\"response\",\"created_at\":1758124121,\"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_056752929fab4ee60068cad859b8188190992c3e7c144e5c02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":698,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":73,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json new file mode 100644 index 0000000000..7458f4bfa3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ApaxPhkJwty9gf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"24whsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"j1G3Fd716beeM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ogDWtfsL09yxf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"t2IMz2OGVnTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DYjavyGFljVUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4vEMhBQ3tB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"S0yos7vpsh7A6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"O60yao8u0QbzdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WWIi6Agx0F1FT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wkqnBu9Ni1RuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ummOEaBJnHB43ps\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lCxXTylRn23WCxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sTKFxw61aIPdf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ubsQ6uok0Yv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NT02RroSoBWPV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UEU9XVzM8tot0AW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"RzGWucG3ekOlHGc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"wrQA0R3IXPuqfFp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"n00QdnvqMIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"uIovyjhDejBK4Bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3YzNMdfx8IO8Lw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KjZiP8NwGZNz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"9qqwVYyYqFm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"uVlN3QNib\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"d0zgwObj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"N3Jv0y4awCg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CogKYXtCAXOLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"pWIVp3RYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zdK9fh2mN9VSo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"RcJRBmGITRk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"DoDOVlOMy4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OG6EOvWyUporX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"JWQXnpWYapK3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"r3mNRBKHJHgI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"ZY7oyXRuwYgb6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"0sBjQWespUNbAz2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"GHmFzszSMZLY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"s6jycxbgvOT6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GRy6y304vUPg1XY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ltC41nS8gnjHUXq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"AwYLVJoJr5sadL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"tueRqcFRu4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"btBXtQ6PtsxgZGx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"24VGamNwoXtOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"nukCWfE1CwH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"5Uhg5NNtsZnjB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"yKTeEdYbvz7w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"L4oaBFekQeHgI96\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"jBGmjQc67VuOjY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"DtZySAZ1GXad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"2q0eNipBGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"j1kszk9qAjllM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"B0oENlgarsl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"mROD6vpvFn4DCGR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"zu8AiCkA0AFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"KVmjC6HZt4y9Jha\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"c1l3xrhNzEZ8NR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"WF99lmt3GG6drDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"xr2GMXDzdNDHLer\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"ogMu1uQOppf0a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vs0YKbkuzHqwAOj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"8HVSEPKGuXvc1Gt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"3UzavizbG8Jmf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"E9S2CEE5PlS6NO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CKyBqg36pl3Eix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4FDEifUJS7I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"eOu3BXUyZo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Iso6v5636D8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"thCLBaZFEU9o7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"nHUjC9hg9tgO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"hL7AHRZli41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TL8emLrzgLXpmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UBkbwSw6iqq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"sH9LPwObeX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DT3zbZdt8DroK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"igxp49WEPx6I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"U3PvhFDToTwfWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"AV0taZBTZdv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"4KeJw9rQlL8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"NHnkLeh3RQC2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cFNe8IfzaF1E4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"ci8XdqiG9Bwix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"uAIySAaUK4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"d6M9ivuNRDP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"rZ8pXEMgurej\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"D1dvD4WCXiR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"sdQPfaaFR3gXrT9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"T1hNWhga3Coyoe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"25FahRexc7Kds1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":824},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json deleted file mode 100644 index 82afb81e1d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_23860fc29605f9328d6e0b5beceedd02.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rFPnVuhXKFK05e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"789fOg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"vI61UB7SzbAIW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AOMVKKDvz4hWOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"d50FQfnDI72c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HO7Wh3VeiShWq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BFwQEBuHfC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Tgy2ShwPwmmA1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qYz94hr9hZQkdx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x4Fkt8h7C8343\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wN6RTr4eqMV0r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Q7jECy7OkJaYyZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"d3Lmk1yRqcnUZKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LAH8jSWlclHT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"hRds0fkgJUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7mc7SFbKgsJdN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"lji8ldtE5Xw8O39\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"7weKfn7104o95p9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"smIIkzOfxi3fRV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"oouoOC2cBb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"DLsza95zTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"l2GDKMnGjre8UAF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"Y9klNFJWlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VPcBBHhqUjSRJU0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Row3JW6Cq4kcSM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WT5WN1vYCvxX0L\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_05ddaddbd7e0dc500068cad8639af88190a26933e20baeaf1d\",\"object\":\"response\",\"created_at\":1758124131,\"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_05ddaddbd7e0dc500068cad86424f4819098cae81ed41fb33b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":686,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json new file mode 100644 index 0000000000..529ee82f75 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dITV8KrkFzVlLx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"671NSH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"VxDd7I68KosjW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"soAPr6bWoHut3Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"iyHld7D0usJR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8sLwfpTLRpsKQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"LB8Hl9568l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0GJNlHGKvDope\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"AhKusu6t2mORZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4jo2Xc6JDEViZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"eBCKWAPj5fis9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sHP4IGMiqcXs2H5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RDaCg0Rj9nWD9r9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PwVRSquIZLxvf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QXVhnYU8yq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"R6e6JoyBJXiVP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hga9HhsiIWmEtfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3h7LUg85j0TlETR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"3yQa5iFcaCfwHA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"DENNsWWRad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"lF0eaC6tNu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"hVWFZ0QjNXMqC3g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"NTCFzyMMmA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"mtqkNm9MDI77Tgv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"m8n9uTigw6uz0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"rb4lvbiOp7rLA2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":714,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":745},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json new file mode 100644 index 0000000000..d49fd118bd --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0hzwsQEf6UbqG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"lJHE2K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RfM9TBRDngWR2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"mcGUw7ehqZf4Kp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"5BDFdGRRmZvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FAGk3OhbldIgQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6lq0PdFvfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jeRWzotXlHBPH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1mpFCSyKrbeueZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tYIMtqZ898pOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"1hsAcgVmd7zIU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"6VWhdOECAKxMdVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"w6p64RetELUMJUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jF3mXGcXVhGih\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"tZs4Mj7tU0g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zNqrk0VK15XhR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RhVd7qmmngaGdkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Hz6dfFTrDmceHaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"q9FdilGpew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"SBuT92QpQzPeoua\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"B8EU1EHEav9QKZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"vwWNrocYPs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"vjR1PiumYns4kAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"JCBQqsN70xl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GVqCSvEUFueuQB4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"P3Zu7TW08ehWYj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OxBlbNEBAfneVX\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":721,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json deleted file mode 100644 index 13d2db5948..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_fce264c033bc4b8dc3ab4110f96211a9.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Fb3Nlt59YpcdYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JZnNB9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"BV0C4PEhStuqA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LaPVlUhsUbVtWr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"cP4zlO3EvNlQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"K5DFQxIYiIBq2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QdmFQ8TPoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sedAvL7jFoVVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"niFBeNiZvUXvba\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tSt5TtGZmnQWq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"6vewRzS6fTMA6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"hPA1xBXPMdNvEIL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rpyDeTw8WdIAomQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bN2hHukxBiXKO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BYLIDoG5qOE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OaC5ekzzVUr6y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"u25fe9tDGljatlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xFihGu4anvpBsPO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HLGahjmiz7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"C6T7LShYrkZIfCC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"nEjothEOia1dtf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"9QvJcod3kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"CixxJocEb4PTsBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"mKISvoMrofu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"iP5UKa0wzuozxEZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"NenwtSMVUlPbMn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OK0iGBXLfwan2q\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_07178ac30e92922f0068cad861708c819381c3d32f5c3ba54d\",\"object\":\"response\",\"created_at\":1758124129,\"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_07178ac30e92922f0068cad86226b481938778844f4c2af50e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":693,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":725},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json new file mode 100644 index 0000000000..511da2cb70 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LWkxU1RXRZdvdh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oloBma\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MiW6shJvLNnr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dGWQW9GwaSVxwu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1DGe0viVGtGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oxXoYJQwfkHMj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bYzXV4cy6D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"S4dyHnZ7TT9lZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"h9Bpd5eHvMmnpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MkgI6nAVPFATa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"QHPBJmhVSnvfl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"1JWCpeWzm48EWbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Ss35351tBrwOO5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"K113NDFQIcYMd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"0hLhK3EbNXB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NPWHveJ10pDpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"l5zmgPuY3kIIodb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yFbVKDf2EkNSws8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"UPGK0SfdPddKZ91\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"BQlYLld4Mwi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"KGO6Ds86ohlYb6v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ChoeYlNJjsn3Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"vP4XCfgAr6Hb6F\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json deleted file mode 100644 index 8e659a3005..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_de89161ffe07c2ee9d023475081863c1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3zA6dxvisfR5vX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"U4d4uH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"9zERYEYYfywbD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZXv9gEBslLI1Tc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"9uVFvHMLBU2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SS17gLAnVOaNl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ZqfTFrcCHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Bp1V571L6xzAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"nIePBmc38stMi7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CaKes6cgyJmTl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"hAdQG0e5sk6tk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"jRBVn1T4OT3GVsb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"dsy4bFhg1HRIBBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8fi2oxEl9NqTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"azIGbaYZoJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S1BUy3eRs6aB2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"oSS5jZTeh13M94J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"p8Egf38VsdX3Vme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"L3nK5meFrxlrVlO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"96ZVRTVUtZ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"QgAKqGIErsHtf4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"KeYgjbokgktlKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"52NuO7krlaNfRj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_0771b8305b50a6a70068cad55fbaf48194912e1d45c0f7a4be\",\"object\":\"response\",\"created_at\":1758123359,\"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_0771b8305b50a6a70068cad561037881949ffef30471312e00\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hallo

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":526,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":552},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json new file mode 100644 index 0000000000..774f39ca39 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"zQk004fMpoQ5aU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"kbvcCO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"KGgK3ML4ilADo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lGKwTklol6rEUL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"5dJ8GzlBou3X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"V7KLCi5ksW7yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"g3OLWz2v22\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"osTyyuQlmzVpC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"AHufot4alKo7Em\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EY1DDW7QoWOts\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"BSGitd4zVxzL3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"TXwYEiLsIpAuN8t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"42zX81eL1jVBvLt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4TlEaDslTyk8e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"c7WPLGIuxRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IJBioIS1qkO2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CDfUTMRuCJgYo1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"d9jda4Tsvungxt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"lDv6zJjhEGggNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"LcoHNfJaVFygoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"h5nbOVYydfjalvi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"k7UwgQ0Jc1Kl1D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"agU5a0cBdTmk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"kmoUT13UQdNtBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"CjnVlLZgkAFD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"uhehx1V9i6Kq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4oe3A2kLK0q3Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9LQVsfYV4c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fMpwJnVXqi5ee\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ZL7834DBRPHsAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TFaxqkvf7W1h8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"gTfRhJ98xWLLv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"OOByhZYbNQABTz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fh8QOPKjfAjTuBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IPHk1mwlM1OH6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zpkmlc4H3Om\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"72y6m5QQs06bH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"HxZ3QU51xFaX2G9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"y2VSDfOM8pNok7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"tBU8HqvOdd4Or1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"CyUCv5b37hZR6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"mEk9VFkO2Sy4gpd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"vlXVivhp1eD3j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"xN9jkUjlshZW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"jFsU0PyQfzU494n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2hWKBAFa1oyNik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3dZSv2xelxDqeh\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json deleted file mode 100644 index 6b4466f45a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8729fe16c66e8648ade70660e5914c0e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Apples

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

I need to buy:

\\\"},{\\\"block\\\":\\\"

Apples

\\\"},{\\\"block\\\":\\\"

Bananas

\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lRxUHSPRd0euMc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"X7XenZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"n9dO3cOn4nzh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"mORaFLm5K6MX46\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AQUNcNkhNX1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hakFRCFl7QIeQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"G9KiqmgiGN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WLndUqM2nlXDS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Hs6tV09sG9I5S4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rX3DZnThnfZpb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"D9qXvswzIhLTo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"6RfNuVp4bmVA5jo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"W1DjSLtXrjX53Gp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9WxSmKn8gYUji\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Wj6LOhzwZOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6M02I8xBrGMJV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AxiGAKPm6m2famZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"2c20XZtJShneug\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"H0ZINxvc4JVb17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"zxWPZeK19ElTPV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"6qDaOyQljiLoy24\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"ETJETZrft0O0uy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"kurUORl81sgd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"DMh5Ndah2nixdr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"1362QOVD4u25\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DuxEHGRD0rGD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BrmHVSSUSNIbQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"yFn6gOTejI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IPpMGRPGZ9Jov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"nTfRblxAkKssaY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KayI0HkMyAZ4F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JGLElAj7GrP7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YnPiJuQKE9rAUgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"07mJZa896okXhu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Y7vMzevlyMMtg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"deugxPGuTPf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"L5VqP4QqbcLG1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"14TQeVAC41YtxQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"whEclgyUSPsmjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"towqirdkfI0M4Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"8UMIQFHZtZSYDV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kq6rJhxTKSzMt1j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"R8dJPzg1quUru\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"3Lpk9egq0itf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"OYdcoAfGrNi85FZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Xqai2rHOQDn2mr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"c5R9vBJcbGrtzB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_032910c62aac76090068cad86b960c8195915a82113d5459a4\",\"object\":\"response\",\"created_at\":1758124139,\"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_032910c62aac76090068cad86c4a948195a2bd0d2db0c5aa16\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
  • Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
  • Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":472,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":528},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json deleted file mode 100644 index 30fe35e3a2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a23db5d3055574260d8823221d560ba8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"r3YWpAd8qnLzh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"MsrVf3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"k2mxbbF83qiLC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4xFBACUSfeBhhA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"95ALGwe423Fx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HNI2KWeOCbRCF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"3TeiqonSJ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SL77owBfBAVkr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"d3etjc3JM5Fsa4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BFakFdVGTTi8H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qlwsXN9XhSlUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gfZjz4Z69S1mMoz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"sfS61VEaQnFgoY2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8NnNdvJBDluEt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Ogm81LfZzUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ygXUKdXgCVcpu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"XARq8NR8OPHnTlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"fQvkjvsDJ3VM6yX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"U4y2N7oxZXSQOCS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"QK6py3kmZTePvxy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"GrS2TMxvEm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"w5dLzYygLwilB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"85a3hu0LID3frOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"uPMEYb7Rv6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0cQG1YrECFRjDAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"b68WzZ7Mhwatzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"i4PWFj1vj5tKad\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_07bb8e77757c736e0068cad8552b888194ac511fbc438e0150\",\"object\":\"response\",\"created_at\":1758124117,\"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_07bb8e77757c736e0068cad855a6008194984ed5014910bcbe\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":699,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":730},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json new file mode 100644 index 0000000000..7e0712cfb7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3qmeyfllZhZZQe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"OWkwBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CucgAZ75RHKwQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zs2njuZ6swIkhm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jVenbwN3Lcqj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LAgtWuKQ8z9Yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AOdQBD7ibP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1KrEJlRlyjb0Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"EviqVGLFjkVmQC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x35dwY5RMatei\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"oR2LXQVhCXlXU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1Ilb45l92DvrV09\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lgtYact6v7Dx7nq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qIcdgyTXUngIk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"sUic68ps31N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DA0N0HNu5a5ZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SVGeT7y4YbNobGS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"IyEeDDtu0a5J2xu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"fFN4CMv6oqnjRZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"epBYstOn5EWT4iX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"3ROYiad5Yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"BtbkBZqaOhlHZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"7N2lp7niA98fuP8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"hSDzdoQIQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"pmQuZBAJhS24yfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Hd70seAbUqOTIU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"R9SN7VoUhHA7cB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

What's up, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":727,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":758},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json deleted file mode 100644 index fc23f381ed..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_805bfc82ee9253bcb1cd35617f17fc4d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"S7JFcbF56Hk7yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y1eQmc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0pmp9guGBMrhE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"d44XV0EQ1TWiID\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0tmmMs5i5Hda\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WvnioKtTFLtRJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"C9EWPrLhVd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PIqgavYqmQUYT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"e1g7f6NFucruOH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nWQxhM2zNGCKH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kyp4kXjOTZp2l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"zhm6T96u9YgBO9X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"42fDvtfW1a4TB9R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hsQNrGH1o0HHx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"JfdZMkuRDYx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"X6TVT3YplrfqH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"tyOTgvZ9N8NMsbW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"tuCTgRxT5U0YITT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"nuUKS2e3wBzinHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"SZf5v02uwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"AEYrRXqgUqdOZjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"2UPqZdy8Lz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0OXboHnRXmwZL3Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"QlJcXrcnQBzn6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"UqIfuJ73MRUSk3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_0a2bb77684e190c00068cad5624d3c8197a2e0ea0c1692799a\",\"object\":\"response\",\"created_at\":1758123362,\"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_0a2bb77684e190c00068cad564732481979c467413473fb9eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"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\":688,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json new file mode 100644 index 0000000000..4d94a482b5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HMHZTk41PnnjqL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"38WK40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cijrM4GEPWNlY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"bgyhQ9xK3OLZKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mlO7TqEpMbS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"H34zwd30KDBFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5DVaS7BQ6W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pmOE8SanK1Zwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PUsE7MCOj2Hf37\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OLlXOK7ca3fP3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"IYesxnboofQvc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"X1JoTwtHqKvskFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ixor3O8xBRyBPSn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hobVGMvc1PmgD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"YFjdiaXCzzM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4T2Jt9ogO0nDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6ywpmqCfrfoFAVS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"kznVRGnRqLACvsz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"l3kWLXNGJRT9qUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"uZaCuP8WjD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9xYMIaChVPKQjli\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"RTsT66DMVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"U3bWGymJJZrGsW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AuSkRjZBOlaobN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uk1ZBSLXALj7Yg\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":745},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file From 6066f2aaf8a34c14061d99ef0cec2085aeceb386 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 17 Sep 2025 23:57:30 +0200 Subject: [PATCH 39/68] disable test --- packages/xl-ai/src/api/formats/json/errorHandling.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index cbffab03a1..41d066a579 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -22,7 +22,8 @@ const openai = createOpenAI({ })("gpt-4o-2024-08-06"); // Separate test suite for error handling with its own server -describe("Error handling", () => { +// TODO +describe.skip("Error handling", () => { // Create a separate server for error tests with custom handlers const errorServer = setupServer(); From 6eb79ddd7ffc4de576ba59b92d7f70a5653afab4 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 18 Sep 2025 00:04:43 +0200 Subject: [PATCH 40/68] hardcode example server --- examples/09-ai/01-minimal/src/getEnv.ts | 10 +++++++--- examples/09-ai/02-playground/src/getEnv.ts | 10 +++++++--- examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts | 10 +++++++--- examples/09-ai/04-with-collaboration/src/getEnv.ts | 10 +++++++--- examples/09-ai/05-manual-execution/src/getEnv.ts | 10 +++++++--- examples/09-ai/06-server-execution/src/getEnv.ts | 10 +++++++--- 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/examples/09-ai/01-minimal/src/getEnv.ts b/examples/09-ai/01-minimal/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/01-minimal/src/getEnv.ts +++ b/examples/09-ai/01-minimal/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/02-playground/src/getEnv.ts b/examples/09-ai/02-playground/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/02-playground/src/getEnv.ts +++ b/examples/09-ai/02-playground/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts b/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts +++ b/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/04-with-collaboration/src/getEnv.ts b/examples/09-ai/04-with-collaboration/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/04-with-collaboration/src/getEnv.ts +++ b/examples/09-ai/04-with-collaboration/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/05-manual-execution/src/getEnv.ts b/examples/09-ai/05-manual-execution/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/05-manual-execution/src/getEnv.ts +++ b/examples/09-ai/05-manual-execution/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/06-server-execution/src/getEnv.ts b/examples/09-ai/06-server-execution/src/getEnv.ts index b225fc462e..677edd9d03 100644 --- a/examples/09-ai/06-server-execution/src/getEnv.ts +++ b/examples/09-ai/06-server-execution/src/getEnv.ts @@ -6,13 +6,17 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: - process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + BLOCKNOTE_AI_SERVER_BASE_URL: process.env + .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL + ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" + : undefined, }; const value = env[key as keyof typeof env]; From f3d4c52651ee9f7a5279c54e9c0a508a7762f9e4 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 18 Sep 2025 00:17:04 +0200 Subject: [PATCH 41/68] fix urls --- examples/09-ai/01-minimal/src/getEnv.ts | 10 +++------- examples/09-ai/02-playground/src/App.tsx | 3 ++- examples/09-ai/02-playground/src/getEnv.ts | 10 +++------- examples/09-ai/03-custom-ai-menu-items/src/App.tsx | 3 ++- examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts | 10 +++------- examples/09-ai/04-with-collaboration/src/App.tsx | 3 ++- examples/09-ai/04-with-collaboration/src/getEnv.ts | 10 +++------- examples/09-ai/05-manual-execution/src/getEnv.ts | 10 +++------- examples/09-ai/06-server-execution/src/App.tsx | 2 +- examples/09-ai/06-server-execution/src/getEnv.ts | 10 +++------- 10 files changed, 25 insertions(+), 46 deletions(-) diff --git a/examples/09-ai/01-minimal/src/getEnv.ts b/examples/09-ai/01-minimal/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/01-minimal/src/getEnv.ts +++ b/examples/09-ai/01-minimal/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index d60363a1ae..0c2b001492 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -40,7 +40,8 @@ import { getEnv } from "./getEnv"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || + "https://localhost:3000/ai/proxy", }); // return the AI SDK model based on the selected model string diff --git a/examples/09-ai/02-playground/src/getEnv.ts b/examples/09-ai/02-playground/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/02-playground/src/getEnv.ts +++ b/examples/09-ai/02-playground/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index 0bc8b95c29..efb5958b8c 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -33,7 +33,8 @@ import { addRelatedTopics, makeInformal } from "./customAIMenuItems"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || + "https://localhost:3000/ai/proxy", }); // Use an "open" model such as llama, in this case via groq.com diff --git a/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts b/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts +++ b/examples/09-ai/03-custom-ai-menu-items/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index d15c879f60..4e6102b5de 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -61,7 +61,8 @@ const ghostContent = const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || + "https://localhost:3000/ai/proxy", }); // Use an "open" model such as llama, in this case via groq.com diff --git a/examples/09-ai/04-with-collaboration/src/getEnv.ts b/examples/09-ai/04-with-collaboration/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/04-with-collaboration/src/getEnv.ts +++ b/examples/09-ai/04-with-collaboration/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/05-manual-execution/src/getEnv.ts b/examples/09-ai/05-manual-execution/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/05-manual-execution/src/getEnv.ts +++ b/examples/09-ai/05-manual-execution/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx index 47c0949194..99ffa213db 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -23,7 +23,7 @@ import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; const BASE_URL = - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/vercel-ai-sdk" || "https://localhost:3000/ai/vercel-ai-sdk"; export default function App() { diff --git a/examples/09-ai/06-server-execution/src/getEnv.ts b/examples/09-ai/06-server-execution/src/getEnv.ts index 677edd9d03..b225fc462e 100644 --- a/examples/09-ai/06-server-execution/src/getEnv.ts +++ b/examples/09-ai/06-server-execution/src/getEnv.ts @@ -6,17 +6,13 @@ export function getEnv(key: string) { BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env .VITE_BLOCKNOTE_AI_SERVER_API_KEY, BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env - .VITE_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, } : { BLOCKNOTE_AI_SERVER_API_KEY: process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, - BLOCKNOTE_AI_SERVER_BASE_URL: process.env - .NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL - ? "https://blocknote-pr-2007.onrender.com/ai/vercel-ai-sdk" - : undefined, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, }; const value = env[key as keyof typeof env]; From 836689d9f24ea52b26c4662e0cd7ba8eaafc628d Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 18 Sep 2025 15:51:11 +0200 Subject: [PATCH 42/68] add server prompt builder example --- docs/package.json | 2 +- examples/09-ai/01-minimal/.bnexample.json | 2 +- examples/09-ai/01-minimal/package.json | 2 +- examples/09-ai/02-playground/.bnexample.json | 2 +- examples/09-ai/02-playground/package.json | 2 +- examples/09-ai/02-playground/src/App.tsx | 4 +- .../03-custom-ai-menu-items/.bnexample.json | 2 +- .../03-custom-ai-menu-items/package.json | 2 +- .../09-ai/03-custom-ai-menu-items/src/App.tsx | 4 +- .../04-with-collaboration/.bnexample.json | 2 +- .../09-ai/04-with-collaboration/package.json | 2 +- .../09-ai/04-with-collaboration/src/App.tsx | 4 +- .../09-ai/05-manual-execution/.bnexample.json | 2 +- .../09-ai/05-manual-execution/package.json | 2 +- .../09-ai/06-server-execution/.bnexample.json | 2 +- .../09-ai/06-server-execution/package.json | 2 +- .../09-ai/06-server-execution/src/App.tsx | 4 +- .../09-ai/06-server-execution/tsconfig.json | 12 +- .../06-server-promptbuilder/.bnexample.json | 12 ++ .../09-ai/06-server-promptbuilder/README.md | 5 + .../09-ai/06-server-promptbuilder/index.html | 14 ++ .../09-ai/06-server-promptbuilder/main.tsx | 11 ++ .../06-server-promptbuilder/package.json | 31 ++++ .../09-ai/06-server-promptbuilder/src/App.tsx | 173 ++++++++++++++++++ .../06-server-promptbuilder/src/getEnv.ts | 20 ++ .../06-server-promptbuilder/tsconfig.json | 36 ++++ .../06-server-promptbuilder/vite.config.ts | 32 ++++ packages/xl-ai-server/package.json | 2 +- packages/xl-ai-server/src/index.ts | 2 + .../xl-ai-server/src/routes/vercelAiSdk.ts | 10 +- .../src/routes/vercelAiSdkPersistence.ts | 116 ++++++++++++ packages/xl-ai/package.json | 6 +- .../src/api/formats/promptAIRequestSender.ts | 4 + packages/xl-ai/src/api/index.ts | 2 + .../vercelAiSdk/util/chatHandlers.ts | 2 + playground/package.json | 2 +- playground/src/examples.gen.tsx | 36 +++- pnpm-lock.yaml | 157 +++++++++------- 38 files changed, 620 insertions(+), 107 deletions(-) create mode 100644 examples/09-ai/06-server-promptbuilder/.bnexample.json create mode 100644 examples/09-ai/06-server-promptbuilder/README.md create mode 100644 examples/09-ai/06-server-promptbuilder/index.html create mode 100644 examples/09-ai/06-server-promptbuilder/main.tsx create mode 100644 examples/09-ai/06-server-promptbuilder/package.json create mode 100644 examples/09-ai/06-server-promptbuilder/src/App.tsx create mode 100644 examples/09-ai/06-server-promptbuilder/src/getEnv.ts create mode 100644 examples/09-ai/06-server-promptbuilder/tsconfig.json create mode 100644 examples/09-ai/06-server-promptbuilder/vite.config.ts create mode 100644 packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts diff --git a/docs/package.json b/docs/package.json index 6007674cf4..25d79e9303 100644 --- a/docs/package.json +++ b/docs/package.json @@ -69,7 +69,7 @@ "@vercel/analytics": "^1.5.0", "@vercel/og": "^0.6.8", "@y-sweet/react": "^0.6.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "babel-plugin-react-compiler": "19.1.0-rc.2", "better-auth": "^1.2.10", "better-sqlite3": "^11.10.0", diff --git a/examples/09-ai/01-minimal/.bnexample.json b/examples/09-ai/01-minimal/.bnexample.json index c3e9db3c7e..d5446bfa9b 100644 --- a/examples/09-ai/01-minimal/.bnexample.json +++ b/examples/09-ai/01-minimal/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" } diff --git a/examples/09-ai/01-minimal/package.json b/examples/09-ai/01-minimal/package.json index 0fefad75bd..8f951984d5 100644 --- a/examples/09-ai/01-minimal/package.json +++ b/examples/09-ai/01-minimal/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" }, diff --git a/examples/09-ai/02-playground/.bnexample.json b/examples/09-ai/02-playground/.bnexample.json index 9713832f15..8f794c4905 100644 --- a/examples/09-ai/02-playground/.bnexample.json +++ b/examples/09-ai/02-playground/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/google": "^2.0.11", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/openai-compatible": "^1.0.13", diff --git a/examples/09-ai/02-playground/package.json b/examples/09-ai/02-playground/package.json index 133afe0a4d..6cd5289c5d 100644 --- a/examples/09-ai/02-playground/package.json +++ b/examples/09-ai/02-playground/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/google": "^2.0.11", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/openai-compatible": "^1.0.13", diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index 0c2b001492..b17ab4467b 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -40,8 +40,8 @@ import { getEnv } from "./getEnv"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || - "https://localhost:3000/ai/proxy", + (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + + "/proxy", }); // return the AI SDK model based on the selected model string diff --git a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json index 2330041730..7e5acc4ab7 100644 --- a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json +++ b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", diff --git a/examples/09-ai/03-custom-ai-menu-items/package.json b/examples/09-ai/03-custom-ai-menu-items/package.json index 4a1a61f87c..4b019cccb0 100644 --- a/examples/09-ai/03-custom-ai-menu-items/package.json +++ b/examples/09-ai/03-custom-ai-menu-items/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index efb5958b8c..66b0e86949 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -33,8 +33,8 @@ import { addRelatedTopics, makeInformal } from "./customAIMenuItems"; const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || - "https://localhost:3000/ai/proxy", + (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + + "/proxy", }); // Use an "open" model such as llama, in this case via groq.com diff --git a/examples/09-ai/04-with-collaboration/.bnexample.json b/examples/09-ai/04-with-collaboration/.bnexample.json index 86d7b0b93e..308005b9b3 100644 --- a/examples/09-ai/04-with-collaboration/.bnexample.json +++ b/examples/09-ai/04-with-collaboration/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", diff --git a/examples/09-ai/04-with-collaboration/package.json b/examples/09-ai/04-with-collaboration/package.json index 39b786c35d..dc42ae499f 100644 --- a/examples/09-ai/04-with-collaboration/package.json +++ b/examples/09-ai/04-with-collaboration/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index 4e6102b5de..4faf0ef5e7 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -61,8 +61,8 @@ const ghostContent = const client = createBlockNoteAIClient({ apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/proxy" || - "https://localhost:3000/ai/proxy", + (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + + "/proxy", }); // Use an "open" model such as llama, in this case via groq.com diff --git a/examples/09-ai/05-manual-execution/.bnexample.json b/examples/09-ai/05-manual-execution/.bnexample.json index b68b0f7eaf..194d59ac31 100644 --- a/examples/09-ai/05-manual-execution/.bnexample.json +++ b/examples/09-ai/05-manual-execution/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", diff --git a/examples/09-ai/05-manual-execution/package.json b/examples/09-ai/05-manual-execution/package.json index 5befab19b3..f9fa6621e6 100644 --- a/examples/09-ai/05-manual-execution/package.json +++ b/examples/09-ai/05-manual-execution/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", diff --git a/examples/09-ai/06-server-execution/.bnexample.json b/examples/09-ai/06-server-execution/.bnexample.json index 2e6914912b..546fecaf6b 100644 --- a/examples/09-ai/06-server-execution/.bnexample.json +++ b/examples/09-ai/06-server-execution/.bnexample.json @@ -6,7 +6,7 @@ "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/06-server-execution/package.json b/examples/09-ai/06-server-execution/package.json index 929ff45187..9aaea55300 100644 --- a/examples/09-ai/06-server-execution/package.json +++ b/examples/09-ai/06-server-execution/package.json @@ -19,7 +19,7 @@ "react-dom": "^19.1.0", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "zustand": "^5.0.3" }, "devDependencies": { diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-server-execution/src/App.tsx index 99ffa213db..289ddef25c 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-server-execution/src/App.tsx @@ -23,8 +23,8 @@ import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; const BASE_URL = - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") + "/vercel-ai-sdk" || - "https://localhost:3000/ai/vercel-ai-sdk"; + (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + + "/vercel-ai-sdk"; export default function App() { // Creates a new editor instance. diff --git a/examples/09-ai/06-server-execution/tsconfig.json b/examples/09-ai/06-server-execution/tsconfig.json index 9aa203fa0f..dbe3e6f62d 100644 --- a/examples/09-ai/06-server-execution/tsconfig.json +++ b/examples/09-ai/06-server-execution/tsconfig.json @@ -3,7 +3,11 @@ "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, - "lib": ["DOM", "DOM.Iterable", "ESNext"], + "lib": [ + "DOM", + "DOM.Iterable", + "ESNext" + ], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, @@ -18,7 +22,9 @@ "jsx": "react-jsx", "composite": true }, - "include": ["."], + "include": [ + "." + ], "__ADD_FOR_LOCAL_DEV_references": [ { "path": "../../../packages/core/" @@ -27,4 +33,4 @@ "path": "../../../packages/react/" } ] -} +} \ No newline at end of file diff --git a/examples/09-ai/06-server-promptbuilder/.bnexample.json b/examples/09-ai/06-server-promptbuilder/.bnexample.json new file mode 100644 index 0000000000..c04b4cf131 --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/.bnexample.json @@ -0,0 +1,12 @@ +{ + "playground": true, + "docs": false, + "author": "yousefed", + "tags": ["AI", "llm"], + "dependencies": { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^5.0.45", + "zustand": "^5.0.3" + } +} diff --git a/examples/09-ai/06-server-promptbuilder/README.md b/examples/09-ai/06-server-promptbuilder/README.md new file mode 100644 index 0000000000..f5fd500a4e --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/README.md @@ -0,0 +1,5 @@ +# AI Integration with server LLM execution + promptbuilder + +This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor. + +Prompt building is done on the server as well diff --git a/examples/09-ai/06-server-promptbuilder/index.html b/examples/09-ai/06-server-promptbuilder/index.html new file mode 100644 index 0000000000..e231d07321 --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/index.html @@ -0,0 +1,14 @@ + + + + + AI Integration with server LLM execution + promptbuilder + + + +
+ + + diff --git a/examples/09-ai/06-server-promptbuilder/main.tsx b/examples/09-ai/06-server-promptbuilder/main.tsx new file mode 100644 index 0000000000..677c7f7eed --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/main.tsx @@ -0,0 +1,11 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import React from "react"; +import { createRoot } from "react-dom/client"; +import App from "./src/App.jsx"; + +const root = createRoot(document.getElementById("root")!); +root.render( + + + +); diff --git a/examples/09-ai/06-server-promptbuilder/package.json b/examples/09-ai/06-server-promptbuilder/package.json new file mode 100644 index 0000000000..d8f34bcf7c --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/package.json @@ -0,0 +1,31 @@ +{ + "name": "@blocknote/example-ai-server-promptbuilder", + "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "private": true, + "version": "0.12.4", + "scripts": { + "start": "vite", + "dev": "vite", + "build:prod": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@blocknote/core": "latest", + "@blocknote/react": "latest", + "@blocknote/ariakit": "latest", + "@blocknote/mantine": "latest", + "@blocknote/shadcn": "latest", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + "ai": "^5.0.45", + "zustand": "^5.0.3" + }, + "devDependencies": { + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "@vitejs/plugin-react": "^4.3.1", + "vite": "^5.3.4" + } +} diff --git a/examples/09-ai/06-server-promptbuilder/src/App.tsx b/examples/09-ai/06-server-promptbuilder/src/App.tsx new file mode 100644 index 0000000000..9179be108c --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/src/App.tsx @@ -0,0 +1,173 @@ +import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; +import "@blocknote/core/fonts/inter.css"; +import { en } from "@blocknote/core/locales"; +import { BlockNoteView } from "@blocknote/mantine"; +import "@blocknote/mantine/style.css"; +import { + FormattingToolbar, + FormattingToolbarController, + getDefaultReactSlashMenuItems, + getFormattingToolbarItems, + SuggestionMenuController, + useCreateBlockNote, +} from "@blocknote/react"; +import { + AIMenuController, + AIToolbarButton, + createAIExtension, + getAISlashMenuItems, + llmFormats, + promptAIRequestSender, +} from "@blocknote/xl-ai"; +import { en as aiEn } from "@blocknote/xl-ai/locales"; +import "@blocknote/xl-ai/style.css"; +import { DefaultChatTransport, isToolOrDynamicToolUIPart } from "ai"; +import { getEnv } from "./getEnv"; + +const BASE_URL = + (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + + "/vercel-ai-sdk"; + +export default function App() { + // Creates a new editor instance. + const editor = useCreateBlockNote({ + dictionary: { + ...en, + ai: aiEn, // add default translations for the AI extension + }, + // Register the AI extension + extensions: [ + createAIExtension({ + // similar to https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message + // we adjust the transport to not send all messages to the backend + transport: new DefaultChatTransport({ + // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) + api: `${BASE_URL}-persistence/streamText`, + prepareSendMessagesRequest({ id, body, messages, requestMetadata }) { + // we don't send the messages, just the information we need to compose / append messages server-side: + // - the conversation id + // - the promptData + // - the tool results of the last message + + // we need to share data about tool calls with the backend, + // as these can be client-side executed. The backend needs to know the tool outputs + // in order to compose a new valid LLM request + const lastToolParts = + messages.length > 0 + ? messages[messages.length - 1].parts.filter((part) => + isToolOrDynamicToolUIPart(part), + ) + : []; + + return { + body: { + // TODO: this conversation id is client-side generated, we + // should have a server-side generated id to ensure uniqueness + // see https://github.com/vercel/ai/issues/7340#issuecomment-3307559636 + id, + // get the promptData from requestMetadata (set by `promptAIRequestSender`) and send to backend + promptData: (requestMetadata as any).promptData, + ...body, + lastToolParts, + // messages, -> we explicitly don't send the messages array as we compose messages server-side + }, + }; + }, + }), + // customize the aiRequestSender to not update the messages array on the client-side + aiRequestSender: promptAIRequestSender( + async () => {}, // disable the client-side promptbuilder + llmFormats.html.defaultPromptInputDataBuilder, + ), + }), + ], + // We set some initial content for demo purposes + initialContent: [ + { + type: "heading", + props: { + level: 1, + }, + content: "Open source software", + }, + { + type: "paragraph", + content: + "Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.", + }, + { + type: "paragraph", + content: + "One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.", + }, + { + type: "paragraph", + content: + "Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.", + }, + ], + }); + + // Renders the editor instance using a React component. + return ( +
+ + {/* Add the AI Command menu to the editor */} + + + {/* We disabled the default formatting toolbar with `formattingToolbar=false` + and replace it for one with an "AI button" (defined below). + (See "Formatting Toolbar" in docs) + */} + + + {/* We disabled the default SlashMenu with `slashMenu=false` + and replace it for one with an AI option (defined below). + (See "Suggestion Menus" in docs) + */} + + +
+ ); +} + +// Formatting toolbar with the `AIToolbarButton` added +function FormattingToolbarWithAI() { + return ( + ( + + {...getFormattingToolbarItems()} + {/* Add the AI button */} + + + )} + /> + ); +} + +// Slash menu with the AI option added +function SuggestionMenuWithAI(props: { + editor: BlockNoteEditor; +}) { + return ( + + filterSuggestionItems( + [ + ...getDefaultReactSlashMenuItems(props.editor), + // add the default AI slash menu items, or define your own + ...getAISlashMenuItems(props.editor), + ], + query, + ) + } + /> + ); +} diff --git a/examples/09-ai/06-server-promptbuilder/src/getEnv.ts b/examples/09-ai/06-server-promptbuilder/src/getEnv.ts new file mode 100644 index 0000000000..b225fc462e --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/src/getEnv.ts @@ -0,0 +1,20 @@ +// helper function to get env variables across next / vite +// only needed so this example works in BlockNote demos and docs +export function getEnv(key: string) { + const env = (import.meta as any).env + ? { + BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env + .VITE_BLOCKNOTE_AI_SERVER_BASE_URL, + } + : { + BLOCKNOTE_AI_SERVER_API_KEY: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY, + BLOCKNOTE_AI_SERVER_BASE_URL: + process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL, + }; + + const value = env[key as keyof typeof env]; + return value; +} diff --git a/examples/09-ai/06-server-promptbuilder/tsconfig.json b/examples/09-ai/06-server-promptbuilder/tsconfig.json new file mode 100644 index 0000000000..dbe3e6f62d --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/tsconfig.json @@ -0,0 +1,36 @@ +{ + "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": [ + "DOM", + "DOM.Iterable", + "ESNext" + ], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "composite": true + }, + "include": [ + "." + ], + "__ADD_FOR_LOCAL_DEV_references": [ + { + "path": "../../../packages/core/" + }, + { + "path": "../../../packages/react/" + } + ] +} \ No newline at end of file diff --git a/examples/09-ai/06-server-promptbuilder/vite.config.ts b/examples/09-ai/06-server-promptbuilder/vite.config.ts new file mode 100644 index 0000000000..f62ab20bc2 --- /dev/null +++ b/examples/09-ai/06-server-promptbuilder/vite.config.ts @@ -0,0 +1,32 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import react from "@vitejs/plugin-react"; +import * as fs from "fs"; +import * as path from "path"; +import { defineConfig } from "vite"; +// import eslintPlugin from "vite-plugin-eslint"; +// https://vitejs.dev/config/ +export default defineConfig((conf) => ({ + plugins: [react()], + optimizeDeps: {}, + build: { + sourcemap: true, + }, + resolve: { + alias: + conf.command === "build" || + !fs.existsSync(path.resolve(__dirname, "../../packages/core/src")) + ? {} + : ({ + // Comment out the lines below to load a built version of blocknote + // or, keep as is to load live from sources with live reload working + "@blocknote/core": path.resolve( + __dirname, + "../../packages/core/src/" + ), + "@blocknote/react": path.resolve( + __dirname, + "../../packages/react/src/" + ), + } as any), + }, +})); diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index e00500baa0..996a00f3fd 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -45,7 +45,7 @@ "dependencies": { "@hono/node-server": "^1.13.7", "hono": "^4.6.12", - "ai": "^5.0.29", + "ai": "^5.0.45", "@blocknote/xl-ai": "latest", "@ai-sdk/openai": "^2.0.23" }, diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts index 9388e316dd..7f3ce285d8 100644 --- a/packages/xl-ai-server/src/index.ts +++ b/packages/xl-ai-server/src/index.ts @@ -7,6 +7,7 @@ import { createSecureServer } from "node:http2"; import { Agent, setGlobalDispatcher } from "undici"; import { proxyRoute } from "./routes/proxy.js"; import { vercelAiSdkRoute } from "./routes/vercelAiSdk.js"; +import { vercelAiSdkPersistenceRoute } from "./routes/vercelAiSdkPersistence.js"; // make sure our fetch request uses HTTP/2 setGlobalDispatcher( @@ -31,6 +32,7 @@ if (process.env.TOKEN?.length) { app.use("/ai/*", cors()); app.route("/ai/proxy", proxyRoute); app.route("/ai/vercel-ai-sdk", vercelAiSdkRoute); +app.route("/ai/vercel-ai-sdk-persistence", vercelAiSdkPersistenceRoute); const http2 = existsSync("localhost.pem"); serve( diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index 09a16d0121..44ff578076 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -13,7 +13,6 @@ import { tool, } from "ai"; import { Hono } from "hono"; -import { cors } from "hono/cors"; export const vercelAiSdkRoute = new Hono(); @@ -21,7 +20,7 @@ const model = createOpenAI({ apiKey: process.env.OPENAI_API_KEY, })("gpt-4o"); -vercelAiSdkRoute.post("/generateText", cors(), async () => { +vercelAiSdkRoute.post("/generateText", async () => { // can't easily convert generateText response to stream // https://github.com/vercel/ai/issues/8380 throw new Error("not implemented"); @@ -39,7 +38,7 @@ vercelAiSdkRoute.post("/generateText", cors(), async () => { // return result.toDataStreamResponse(); }); -vercelAiSdkRoute.post("/streamText", cors(), async (c) => { +vercelAiSdkRoute.post("/streamText", async (c) => { const { messages, streamTools } = await c.req.json(); const result = streamText({ @@ -49,6 +48,7 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { operations: tool({ name: "operations", inputSchema: jsonSchema(streamTools), + outputSchema: jsonSchema({ type: "object" }), }), }, }); @@ -56,7 +56,7 @@ vercelAiSdkRoute.post("/streamText", cors(), async (c) => { return result.toUIMessageStreamResponse(); }); -vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { +vercelAiSdkRoute.post("/streamObject", async (c) => { const { messages, streamTools } = await c.req.json(); const schema = jsonSchema(streamTools); const result = streamObject({ @@ -74,7 +74,7 @@ vercelAiSdkRoute.post("/streamObject", cors(), async (c) => { return createUIMessageStreamResponse({ stream }); }); -vercelAiSdkRoute.post("/generateObject", cors(), async (c) => { +vercelAiSdkRoute.post("/generateObject", async (c) => { const { messages, streamTools } = await c.req.json(); const schema = jsonSchema(streamTools); diff --git a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts new file mode 100644 index 0000000000..623772b37e --- /dev/null +++ b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts @@ -0,0 +1,116 @@ +import { createOpenAI } from "@ai-sdk/openai"; +import { llmFormats } from "@blocknote/xl-ai"; +import { + convertToModelMessages, + createIdGenerator, + isToolOrDynamicToolUIPart, + jsonSchema, + streamText, + tool, + UIMessage, + UIMessagePart, + validateUIMessages, +} from "ai"; +import { Hono } from "hono"; + +export const vercelAiSdkPersistenceRoute = new Hono(); + +const model = createOpenAI({ + apiKey: process.env.OPENAI_API_KEY, +})("gpt-4o"); + +// Stores chats in memory +// for a more realistic pattern, +// see https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#starting-a-new-chat +const messageStorage = new Map[]>(); + +// stub, usually would do a database call +async function loadChat(id: string) { + if (!messageStorage.has(id)) { + messageStorage.set(id, []); + } + return [...messageStorage.get(id)!]; // clone +} + +// stub, usually would do a database call +async function saveChat({ + chatId, + messages, +}: { + chatId: string; + messages: UIMessage[]; +}): Promise { + messageStorage.set(chatId, messages); +} + +// follows this example: +// https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message +vercelAiSdkPersistenceRoute.post("/streamText", async (c) => { + const { id, promptData, streamTools, lastToolParts } = await c.req.json(); + + const tools = { + operations: tool({ + name: "operations", + inputSchema: jsonSchema(streamTools), + outputSchema: jsonSchema({ type: "object" }), + }), + }; + + // load the previous messages from the server: + const messages = await loadChat(id); + + const toolParts = (lastToolParts as any[]).filter((part: any) => + isToolOrDynamicToolUIPart(part), + ); + + // get results from tool parts to update the last message + if (messages.length > 0 && toolParts.length > 0) { + const lastMessage = messages[messages.length - 1]; + + messages[messages.length - 1] = { + ...lastMessage, + parts: lastMessage.parts.map((part) => { + if (isToolOrDynamicToolUIPart(part)) { + const matchingToolPart = toolParts.find( + (toolPart) => toolPart.toolCallId === part.toolCallId, + ); + if (matchingToolPart) { + return { + ...part, + state: matchingToolPart.state, + output: matchingToolPart.output, + errorText: matchingToolPart.errorText, + } as UIMessagePart; + } + } + return part; + }), + }; + } + + await llmFormats.html.defaultPromptBuilder(messages, promptData); + + // validate messages if they contain tools, metadata, or data parts: + const validatedMessages = await validateUIMessages({ + messages, + tools, + }); + + const result = streamText({ + model, + messages: convertToModelMessages(validatedMessages), + tools, + }); + + return result.toUIMessageStreamResponse({ + // Generate consistent server-side IDs for persistence: + generateMessageId: createIdGenerator({ + prefix: "msg", + size: 16, + }), + originalMessages: validatedMessages, + onFinish: ({ messages }) => { + saveChat({ chatId: id, messages }); + }, + }); +}); diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index b75dad91bb..9d690d3a41 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -70,9 +70,9 @@ "@blocknote/react": "0.38.0", "@floating-ui/react": "^0.26.4", "@tiptap/core": "^3.4.3", - "ai": "^5.0.29", - "@ai-sdk/react": "^2.0.39", - "@ai-sdk/provider-utils": "^3.0.7", + "ai": "^5.0.45", + "@ai-sdk/react": "^2.0.45", + "@ai-sdk/provider-utils": "^3.0.9", "lodash.isequal": "^4.5.0", "prosemirror-changeset": "^2.3.0", "prosemirror-model": "^1.25.3", diff --git a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts index fa3811a046..c12d083bf9 100644 --- a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts +++ b/packages/xl-ai/src/api/formats/promptAIRequestSender.ts @@ -28,6 +28,10 @@ export function promptAIRequestSender( aiRequest.blockNoteUserPrompt.streamTools, ), }, + // we pass the promptData as metadata + // so the transport can decide whether or not to submit this to the server + // (DefaultChatTransport will not) + metadata: { promptData }, }); }, }; diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 9ac4d902b1..635c6bbd58 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -50,4 +50,6 @@ export const llmFormats = { // export { doLLMRequest as callLLM } from "./LLMRequest.js"; // export { LLMResponse } from "./LLMResponse.js"; +export { promptAIRequestSender } from "./formats/promptAIRequestSender.js"; +export * from "./formats/PromptBuilder.js"; export { promptHelpers } from "./promptHelpers/index.js"; diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 0976d52f8d..4ff3153f48 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -5,6 +5,8 @@ import { StreamTool, StreamToolCall } from "../../streamTool.js"; import { StreamToolExecutor } from "../../StreamToolExecutor.js"; import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsResult.js"; +// TODO: comment file + design decisions + // Types for tool call streaming type ToolCallStreamData = { stream: TransformStream[] }>>; diff --git a/playground/package.json b/playground/package.json index a6d5339f8e..6f32e757b1 100644 --- a/playground/package.json +++ b/playground/package.json @@ -54,7 +54,7 @@ "@uppy/webcam": "^3.4.2", "@uppy/xhr-upload": "^3.4.0", "@y-sweet/react": "^0.6.3", - "ai": "^5.0.29", + "ai": "^5.0.45", "autoprefixer": "10.4.21", "docx": "^9.0.2", "react": "^19.1.0", diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 642650415a..7860cf9f16 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1512,7 +1512,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", "@ai-sdk/groq": "^2.0.16", zustand: "^5.0.3", } as any, @@ -1537,7 +1537,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", "@ai-sdk/google": "^2.0.11", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/openai-compatible": "^1.0.13", @@ -1567,7 +1567,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", "@ai-sdk/openai": "^2.0.23", "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", @@ -1594,7 +1594,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", yjs: "^13.6.27", @@ -1621,7 +1621,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", yjs: "^13.6.27", @@ -1648,7 +1648,7 @@ export const examples = { dependencies: { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.29", + ai: "^5.0.45", zustand: "^5.0.3", } as any, }, @@ -1660,6 +1660,30 @@ export const examples = { readme: "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor", }, + { + projectSlug: "server-promptbuilder", + fullSlug: "ai/server-promptbuilder", + pathFromRoot: "examples/09-ai/06-server-promptbuilder", + config: { + playground: true, + docs: false, + author: "yousefed", + tags: ["AI", "llm"], + dependencies: { + "@blocknote/xl-ai": "latest", + "@mantine/core": "^7.17.3", + ai: "^5.0.45", + zustand: "^5.0.3", + } as any, + }, + title: "AI Integration with server LLM execution + promptbuilder", + group: { + pathFromRoot: "examples/09-ai", + slug: "ai", + }, + readme: + "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor.\n\nPrompt building is done on the server as well", + }, ], }, "vanilla-js": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee9367db27..5364476923 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -232,8 +232,8 @@ importers: specifier: ^0.6.3 version: 0.6.4(react@19.1.0)(yjs@13.6.27) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) babel-plugin-react-compiler: specifier: 19.1.0-rc.2 version: 19.1.0-rc.2 @@ -3142,8 +3142,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3209,8 +3209,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3264,8 +3264,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3319,8 +3319,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3377,8 +3377,8 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -3432,8 +3432,57 @@ importers: specifier: ^7.17.3 version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) + react: + specifier: ^19.1.0 + version: 19.1.0 + react-dom: + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) + zustand: + specifier: ^5.0.3 + version: 5.0.3(@types/react@19.1.8)(immer@10.1.1)(react@19.1.0)(use-sync-external-store@1.5.0(react@19.1.0)) + devDependencies: + '@types/react': + specifier: ^19.1.0 + version: 19.1.8 + '@types/react-dom': + specifier: ^19.1.0 + version: 19.1.6(@types/react@19.1.8) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.4.1(vite@5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.44.0)) + vite: + specifier: ^5.3.4 + version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.44.0) + + examples/09-ai/06-server-promptbuilder: + dependencies: + '@blocknote/ariakit': + specifier: latest + version: link:../../../packages/ariakit + '@blocknote/core': + specifier: latest + version: link:../../../packages/core + '@blocknote/mantine': + specifier: latest + version: link:../../../packages/mantine + '@blocknote/react': + specifier: latest + version: link:../../../packages/react + '@blocknote/shadcn': + specifier: latest + version: link:../../../packages/shadcn + '@blocknote/xl-ai': + specifier: latest + version: link:../../../packages/xl-ai + '@mantine/core': + specifier: ^7.17.3 + version: 7.17.3(@mantine/hooks@7.17.3(react@19.1.0))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + ai: + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) react: specifier: ^19.1.0 version: 19.1.0 @@ -4158,11 +4207,11 @@ importers: packages/xl-ai: dependencies: '@ai-sdk/provider-utils': - specifier: ^3.0.7 - version: 3.0.7(zod@3.25.76) + specifier: ^3.0.9 + version: 3.0.9(zod@3.25.76) '@ai-sdk/react': - specifier: ^2.0.39 - version: 2.0.39(react@19.1.0)(zod@3.25.76) + specifier: ^2.0.45 + version: 2.0.45(react@19.1.0)(zod@3.25.76) '@blocknote/core': specifier: 0.38.0 version: link:../core @@ -4182,8 +4231,8 @@ importers: specifier: https://pkg.pr.new/@tiptap/core@5e777c9 version: https://pkg.pr.new/@tiptap/core@5e777c9(@tiptap/pm@3.4.3) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) lodash.isequal: specifier: ^4.5.0 version: 4.5.0 @@ -4327,8 +4376,8 @@ importers: specifier: ^1.13.7 version: 1.14.0(hono@4.7.5) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) hono: specifier: ^4.6.12 version: 4.7.5 @@ -4798,8 +4847,8 @@ importers: specifier: ^0.6.3 version: 0.6.4(react@19.1.0)(yjs@13.6.27) ai: - specifier: ^5.0.29 - version: 5.0.29(zod@3.25.76) + specifier: ^5.0.45 + version: 5.0.45(zod@3.25.76) autoprefixer: specifier: 10.4.21 version: 10.4.21(postcss@8.5.6) @@ -4952,14 +5001,8 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 - '@ai-sdk/gateway@1.0.15': - resolution: {integrity: sha512-xySXoQ29+KbGuGfmDnABx+O6vc7Gj7qugmj1kGpn0rW0rQNn6UKUuvscKMzWyv1Uv05GyC1vqHq8ZhEOLfXscQ==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.25.76 || ^4 - - '@ai-sdk/gateway@1.0.20': - resolution: {integrity: sha512-2K0kGnHyLfT1v2+3xXbLqohfWBJ/vmIh1FTWnrvZfvuUuBdOi2DMgnSQzkLvFVLyM8mhOcx+ZwU6IOOsuyOv/w==} + '@ai-sdk/gateway@1.0.23': + resolution: {integrity: sha512-ynV7WxpRK2zWLGkdOtrU2hW22mBVkEYVS3iMg1+ZGmAYSgzCqzC74bfOJZ2GU1UdcrFWUsFI9qAYjsPkd+AebA==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4 @@ -5000,8 +5043,8 @@ packages: peerDependencies: zod: ^3.25.76 || ^4 - '@ai-sdk/provider-utils@3.0.8': - resolution: {integrity: sha512-cDj1iigu7MW2tgAQeBzOiLhjHOUM9vENsgh4oAVitek0d//WdgfPCsKO3euP7m7LyO/j9a1vr/So+BGNdpFXYw==} + '@ai-sdk/provider-utils@3.0.9': + resolution: {integrity: sha512-Pm571x5efqaI4hf9yW4KsVlDBDme8++UepZRnq+kqVBWWjgvGhQlzU8glaFq0YJEB9kkxZHbRRyVeHoV2sRYaQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4 @@ -5010,8 +5053,8 @@ packages: resolution: {integrity: sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==} engines: {node: '>=18'} - '@ai-sdk/react@2.0.39': - resolution: {integrity: sha512-cBQZQG3ZtEebBPCcDVJGS4BU6e4ADgnO2PRhqvkPcPeFM68LK+x5E0VJcpLWUuoAW1Lv/yqy62LN3Ql1mFbzYQ==} + '@ai-sdk/react@2.0.45': + resolution: {integrity: sha512-jrTeBQpIsueV6EB/L6KNdH/yadK/Ehx1qCus+9RC29kRikVhjgj8xNvHfH3qHCwsfGqLX9ljj69dCRLrmzpvnw==} engines: {node: '>=18'} peerDependencies: react: ^18 || ^19 || ^19.0.0-rc @@ -10044,14 +10087,8 @@ packages: resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} - ai@5.0.29: - resolution: {integrity: sha512-jA/d6X5hn3r/PxgZjwzDUMJiEkLBIVVD2gcbpcT/FD4MSLxm5sn6fH1y2VFXVgBEd95mNzQ8ALQubysc6E8Y9g==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.25.76 || ^4 - - ai@5.0.39: - resolution: {integrity: sha512-1AOjTHY8MUY4T/X/I+otGTbvKmMQCCGWffuVDyQ21l/2Vv/QoLZcw+ZZHVvp+wvQcPOsfXjURGSFZtin7rnghA==} + ai@5.0.45: + resolution: {integrity: sha512-go6J78B1oTXZMN2XLlNJnrFxwcqXQtpPqUVyk1wvzvpb2dk5nP9yNuxqqOX9HrrKuf5U9M6rSezEJWr1eEG9RA==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4 @@ -15285,16 +15322,10 @@ snapshots: '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) zod: 3.25.76 - '@ai-sdk/gateway@1.0.15(zod@3.25.76)': - dependencies: - '@ai-sdk/provider': 2.0.0 - '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) - zod: 3.25.76 - - '@ai-sdk/gateway@1.0.20(zod@3.25.76)': + '@ai-sdk/gateway@1.0.23(zod@3.25.76)': dependencies: '@ai-sdk/provider': 2.0.0 - '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) + '@ai-sdk/provider-utils': 3.0.9(zod@3.25.76) zod: 3.25.76 '@ai-sdk/google@2.0.11(zod@3.25.76)': @@ -15334,7 +15365,7 @@ snapshots: eventsource-parser: 3.0.6 zod: 3.25.76 - '@ai-sdk/provider-utils@3.0.8(zod@3.25.76)': + '@ai-sdk/provider-utils@3.0.9(zod@3.25.76)': dependencies: '@ai-sdk/provider': 2.0.0 '@standard-schema/spec': 1.0.0 @@ -15345,10 +15376,10 @@ snapshots: dependencies: json-schema: 0.4.0 - '@ai-sdk/react@2.0.39(react@19.1.0)(zod@3.25.76)': + '@ai-sdk/react@2.0.45(react@19.1.0)(zod@3.25.76)': dependencies: - '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) - ai: 5.0.39(zod@3.25.76) + '@ai-sdk/provider-utils': 3.0.9(zod@3.25.76) + ai: 5.0.45(zod@3.25.76) react: 19.1.0 swr: 2.3.6(react@19.1.0) throttleit: 2.1.0 @@ -21292,19 +21323,11 @@ snapshots: agent-base@7.1.3: {} - ai@5.0.29(zod@3.25.76): - dependencies: - '@ai-sdk/gateway': 1.0.15(zod@3.25.76) - '@ai-sdk/provider': 2.0.0 - '@ai-sdk/provider-utils': 3.0.7(zod@3.25.76) - '@opentelemetry/api': 1.9.0 - zod: 3.25.76 - - ai@5.0.39(zod@3.25.76): + ai@5.0.45(zod@3.25.76): dependencies: - '@ai-sdk/gateway': 1.0.20(zod@3.25.76) + '@ai-sdk/gateway': 1.0.23(zod@3.25.76) '@ai-sdk/provider': 2.0.0 - '@ai-sdk/provider-utils': 3.0.8(zod@3.25.76) + '@ai-sdk/provider-utils': 3.0.9(zod@3.25.76) '@opentelemetry/api': 1.9.0 zod: 3.25.76 From 127964dd273af5f3c052596e415d179cd3192447 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 18 Sep 2025 15:56:29 +0200 Subject: [PATCH 43/68] update comment --- examples/09-ai/06-server-promptbuilder/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/09-ai/06-server-promptbuilder/src/App.tsx b/examples/09-ai/06-server-promptbuilder/src/App.tsx index 9179be108c..9114590077 100644 --- a/examples/09-ai/06-server-promptbuilder/src/App.tsx +++ b/examples/09-ai/06-server-promptbuilder/src/App.tsx @@ -41,7 +41,7 @@ export default function App() { // similar to https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message // we adjust the transport to not send all messages to the backend transport: new DefaultChatTransport({ - // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) + // (see packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts) api: `${BASE_URL}-persistence/streamText`, prepareSendMessagesRequest({ id, body, messages, requestMetadata }) { // we don't send the messages, just the information we need to compose / append messages server-side: From 762e155997fde6c0d616beee4c8ea7bd2ce9ace1 Mon Sep 17 00:00:00 2001 From: yousefed Date: Fri, 19 Sep 2025 12:09:07 +0200 Subject: [PATCH 44/68] fix tests + refactor --- .../xl-ai-server/src/routes/vercelAiSdk.ts | 11 +- .../src/routes/vercelAiSdkPersistence.ts | 4 +- .../formats/base-tools/createAddBlocksTool.ts | 177 +++++++++--------- .../base-tools/createUpdateBlockTool.ts | 139 +++++++------- .../src/api/formats/base-tools/delete.ts | 42 +++-- ...ck_1_0e5edfd25f60308e612767de12847e8d.json | 15 -- ...d)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json | 15 -- ...c)_1_96826a43db728a07477682898c006eec.json | 15 -- ...d)_1_c1da093b93c714a83bb7c0d1ddd97412.json | 15 -- ...t)_1_be93e9492f5031d7a78c65393f7a1d75.json | 15 -- ...ck_1_d609d910fa35913532281cbe974c5f07.json | 15 ++ ...d)_1_c3577a8e8564c8deb1c89af291d8b2a0.json | 15 ++ ...c)_1_90633e6f6455774f126fcf81b6dd9a24.json | 15 ++ ...d)_1_796e6ec366f12b12cee29e254e861248.json | 15 ++ ...t)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json | 15 ++ ...ck_1_44b361a973e7aecbab9d27adfb8d78c9.json | 15 ++ ...d)_1_f182421455591cc5dadcdba4e2287710.json | 15 ++ ...c)_1_669fca905ffa843f4c03a02b3291a774.json | 15 ++ ...d)_1_58b7cd849da82831f201e290e2ba1189.json | 15 ++ ...t)_1_a8f302e46da14449a042cb935cdab331.json | 15 ++ ...ck_1_4fd0655be71caae6b7983603e51af51c.json | 15 -- ...d)_1_db7fbffbd0451f36b760272fc5d21981.json | 15 -- ...c)_1_ec679341141937cec2df7a1a2a6719ba.json | 15 -- ...d)_1_e92ffb458c4c624adaf290660d5e7773.json | 15 -- ...t)_1_7d5253a97f3f342003e32ab92acfff29.json | 15 -- ...k_1_5cb5969256536cfe3360d4c6142e580c.json} | 4 +- ...)_1_cf519dc42b5d5ab96892746983e054f5.json} | 4 +- ...)_1_ee1fc8c443fc731bcf2b941528a18d91.json} | 4 +- ...)_1_bdae0c6bc0379d3a2b9ca48556974339.json} | 4 +- ...)_1_c2cedd1c149bff876a53867177c0583e.json} | 4 +- ...ck_1_d992c1b0be938939bcc2da485962c78b.json | 15 ++ ...d)_1_e6f70767b9e3370015490920e244c4aa.json | 15 ++ ...c)_1_64d30b1e7e1ef3d253c7a06fddde6889.json | 15 ++ ...d)_1_869075fdc1903bdcff077c9815e352cf.json | 15 ++ ...t)_1_6207085019334e4a371c8adaacb140af.json | 15 ++ ...ph_1_9c13225608eaccf4da63366cc1408a11.json | 15 -- ...on_1_c3195620bef1082a4598d4a1033f35e2.json | 15 -- ...ph_1_b818317df42c5cb1679f63409bfb31a7.json | 15 ++ ...on_1_8b91d2f21694112af7f45ddd4338bde2.json | 15 ++ ...ph_1_caba43c1afbac54e222e8482fe7140c5.json | 15 ++ ...on_1_470eaa199fbf28738ba71696a4ce5010.json | 15 ++ ...ph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json | 15 -- ...on_1_2260e18485e60399528d870f6f325109.json | 15 -- ...h_1_d83ed705634e892e8905fadc0f4c5d0b.json} | 4 +- ...on_1_c6fb82e817b9dad69fb7d7369cac5784.json | 2 +- ...ph_1_e0e573f126f8dcfc1d1da436a1631ac1.json | 15 ++ ...on_1_796d3b3fb3726692a8631a770864f39e.json | 15 ++ ...ck_1_05fca597808a6f25433ca045a5ef0559.json | 15 -- ...ck_1_a5a4e168d1753fb5b8e7062282d0fa5a.json | 15 ++ ...ck_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json | 15 ++ ...ck_1_7d6b50b0908779f526df2beeed42aa33.json | 15 -- ...k_1_229a12c5bb3aad2c166d03b0409d2958.json} | 4 +- ...ck_1_c69b87b4051b3dd8570a549150b9f62b.json | 15 ++ ...rk_1_cb7bb5a13c260e01317448090595ee0e.json | 15 -- ...nk_1_8b0fe73e448aa675279e4dba4a804d78.json | 15 -- ...nt_1_488a0d087a0b1e01688f51ae05a3914b.json | 15 -- ...nt_1_c0db573b1364fb7c190c2ff2790eb1d2.json | 15 -- ...on_1_79671ea4a1807abe2acdbdbdc8d1a592.json | 15 -- ...te_1_d11897eebf4af50b80d9b0af2a1cc076.json | 15 -- ...rk_1_4b283890bf3b97be66a19afe638bf182.json | 15 -- ...on_1_228afd96384806beba53490617ca02ad.json | 15 -- ...nt_1_d250c0dfa1fc195c3dcd0e1339c06849.json | 15 -- ...op_1_cbe80ccdc904ff27cb59da774ed8d2b3.json | 15 -- ...xt_1_00262aa7e2e7a3dbe561b186222af294.json | 15 -- ...h)_1_8574c26a2e0ef804975798372b6f76c4.json | 15 -- ...d)_1_f4a2bc31383bc00faef808d2933ace4d.json | 15 -- ...on_1_f71f92a2a9a3611028a28c1c24dde70d.json | 15 -- ...st_1_66a84f6298bb99ee6a647822879b2039.json | 15 -- ...nt_1_1b323a77f9c477ec6dc7e0538d496bee.json | 15 -- ...pe_1_4ab38e1cedf41335ad0b75647aa29f9a.json | 15 -- ...rk_1_16f3e9d6c39cf3530b93b0dc18e6f962.json | 15 ++ ...nk_1_f78e880f3984dc08d0d8eae19855fd25.json | 15 ++ ...nt_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json | 15 ++ ...nt_1_f0cc603dc9a00de30b559775758297ca.json | 15 ++ ...on_1_aa486140c2ee9c9c151278673ef5b534.json | 15 ++ ...te_1_3fa32c59b2292d1b9cb65fa4e45865c4.json | 15 ++ ...rk_1_67b1aea5b2196920674bb67095939ff4.json | 15 ++ ...on_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json | 15 ++ ...nt_1_442b81318d9a944cf8cc60b9bed7369e.json | 15 ++ ...op_1_e2b88b585725be6ca65dcd553149b637.json | 15 ++ ...xt_1_673f1e8de9e7cb18c81176e9cc11a8ff.json | 15 ++ ...h)_1_077d4831db306824aecba41d98936e33.json | 15 ++ ...d)_1_beec7f3c8352ec01b4006cca21cddecd.json | 15 ++ ...on_1_8c7f6291076f8d78549724e1e2176d07.json | 15 ++ ...st_1_e71b1d8d60f3f48fbf4965b5050098bd.json | 15 ++ ...nt_1_d3c3951246fca856a169f08af7ad3d3c.json | 15 ++ ...pe_1_7d51b0559b55799e605d0ba8bd1c26e2.json | 15 ++ ...rk_1_2caad518075665e79ed6e54db97f3ed3.json | 15 ++ ...nk_1_755a9ba6e33394d07bc82557aa46716a.json | 15 ++ ...nt_1_e902977c579036dbb160ae0eca395ae2.json | 15 ++ ...nt_1_1130f7a86a8f438a27e46fa58ae310d1.json | 15 ++ ...on_1_87e5668d7574f1c705fbf7850b9a97a9.json | 15 ++ ...te_1_303c0500fccb45f2eda1e4971926380e.json | 15 ++ ...rk_1_859bf6c1a4206efc6a89333473cf527a.json | 15 ++ ...on_1_6e430beb6710f43b5e892c456ef287b7.json | 15 ++ ...nt_1_74b402df3bb91868996faa9a1d58ae36.json | 15 ++ ...op_1_6459181dfa5f41379180ef90656d9e17.json | 15 ++ ...xt_1_f98d47fe05796b5268dbe2a71a9bc870.json | 15 ++ ...h)_1_a8802fc6c501e63117df4e9173995563.json | 15 ++ ...d)_1_304ed4716f2500f45211aab067e7e2d6.json | 15 ++ ...on_1_1499e8407f779455394b30013d5582ae.json | 15 ++ ...st_1_d57317519f06e1677e4061f027456024.json | 15 ++ ...nt_1_4b19753f26090bfc459e8d1ccb1d0e7c.json | 15 ++ ...pe_1_0700e190f22707c2b2c2f3d1edce5a21.json | 15 ++ ...rk_1_e09ba6929a837a4a11aa4d124a0e6f22.json | 15 -- ...nk_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json | 15 -- ...nt_1_bfc978f4d5fa050140ca2c1bf5a99e37.json | 15 -- ...nt_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json | 15 -- ...on_1_7eefe9f91a0f30ff02b536d713a150da.json | 15 -- ...te_1_6efde673f529b56639c3a083147525ed.json | 15 -- ...rk_1_4f669f245ffae48dbb6b753c6e4ea671.json | 15 -- ...on_1_da32e9f5bdc9f37e656ea4f08d9ba361.json | 15 -- ...nt_1_0819b3d657557550110223569d969fba.json | 15 -- ...op_1_e4c1051180bfd61bc46515e8f902adab.json | 15 -- ...xt_1_c8a95723767bd6bbda955b9c97bb9655.json | 15 -- ...h)_1_87799e0afe80a948ff1c538b8de016a8.json | 15 -- ...d)_1_c536370803c8d5b8e925f1cbc94df24e.json | 15 -- ...on_1_98ad26809047752edacacdefcb28793e.json | 15 -- ...st_1_b52b1a76b761a53c8fa407c280c1768f.json | 15 -- ...nt_1_d9b21d6453f43da1a720fbbeffd1a49a.json | 15 -- ...pe_1_f198c01d3ae7a854d3ee6112e9912e6d.json | 15 -- ...k_1_8924ab7942a31319ff0bed562dc978c7.json} | 4 +- ...k_1_bb22d361bb5e6f25a9ba5357553fd8f4.json} | 4 +- ...t_1_fce88de162f505469f329e0963496770.json} | 4 +- ...t_1_929f8d5bec1509c88a91cf9dcfa4707c.json} | 4 +- ...n_1_e234ef5080ef199082d042c16b41cc2f.json} | 4 +- ...e_1_80d1c8e8d1c2656834de79b388f2344a.json} | 4 +- ...rk_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json | 15 ++ ...on_1_d9c8e71bc14549ad598958ce78eb8523.json | 15 ++ ...t_1_20b6db0a713d475547adeee41f24da94.json} | 4 +- ...op_1_94f0b12b9b22b4d4309401f9efc0a533.json | 15 ++ ...xt_1_c6781e0373f28bb83c2fade34630129f.json | 15 ++ ...)_1_a8ad37dedc518e45cfc4606b5bec394e.json} | 4 +- ...)_1_49918221a90bc2d25a1288d33f718530.json} | 4 +- ...on_1_6bec6487dfe642d6607cbac3e3567c9b.json | 2 +- ...st_1_195ecfa59c77a5af5b5ce68d4385de24.json | 2 +- ...t_1_559ac20931643831f47c84f41daab0bb.json} | 4 +- ...e_1_9b7c4f0d9b556cda64777fa2c9912299.json} | 4 +- ...rk_1_a5ab12392ecaea8f050e07b016f62dde.json | 15 ++ ...nk_1_88714755dac24eb4dc53b3992c66a843.json | 15 ++ ...nt_1_ca97d41aec2616b40b0bc40893a79c89.json | 15 ++ ...nt_1_3d7ef09df29b651e82a55ccc7129f343.json | 15 ++ ...on_1_2ee4f417a0603cf9f340ca8b84a24be6.json | 15 ++ ...te_1_15387f9c27484f6bf8068f60174c14f6.json | 15 ++ ...rk_1_0f777e7030958cba6d42fcaf488c438c.json | 15 ++ ...rk_1_e3cfb9691a5e35b717f161fbbca0340e.json | 15 -- ...on_1_1a8deecf4e81a3573383a52a8e6961b0.json | 15 ++ ...on_1_d224b9d8b477962fb9264d15a0c91fef.json | 15 -- ...nt_1_99203bad6675a8e8cc354ad0360f1750.json | 15 ++ ...op_1_d3b6c677db865d2bbbea74ccc3753b1a.json | 15 -- ...op_1_df20d773f1b621f01e595ac5d44c3e1b.json | 15 ++ ...xt_1_72da86021e579186b122b75d71128960.json | 15 ++ ...xt_1_9c3a4bff186e595440356fe0647f9b31.json | 15 -- ...h)_1_19ae8517bff1915931b5cde2d97220bb.json | 15 ++ ...d)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json | 15 ++ ...on_1_ff5f616b85fb952da2097208ac01b6cf.json | 15 ++ ...st_1_66322c56af18dc5c6b2e74db37e03fb4.json | 15 ++ ...nt_1_7a047262ac7b92d2c5c967abff011b99.json | 15 ++ ...pe_1_6fcee8488932f8a8d476c5712bf705f6.json | 15 ++ .../html-blocks/defaultHTMLPromptBuilder.ts | 3 +- .../formats/html-blocks/htmlBlocks.test.ts | 20 +- .../api/formats/json/tools/jsontools.test.ts | 1 + .../tests/validateTestEnvironment.test.ts | 10 +- .../src/streamTool/StreamToolExecutor.ts | 56 +++++- packages/xl-ai/src/streamTool/asTool.ts | 2 +- .../filterNewOrUpdatedOperations.test.ts | 21 ++- .../filterNewOrUpdatedOperations.ts | 6 +- .../streamTool/filterValidOperations.test.ts | 5 + .../src/streamTool/filterValidOperations.ts | 4 + packages/xl-ai/src/streamTool/jsonSchema.ts | 2 + .../xl-ai/src/streamTool/preprocess.test.ts | 8 + packages/xl-ai/src/streamTool/preprocess.ts | 3 + packages/xl-ai/src/streamTool/streamTool.ts | 13 +- .../streamTool/toValidatedOperations.test.ts | 1 + .../src/streamTool/toValidatedOperations.ts | 4 + .../clientside/ClientSideTransport.ts | 12 +- .../util/UIMessageStreamToOperationsResult.ts | 11 +- .../vercelAiSdk/util/chatHandlers.ts | 117 +++++++++--- 178 files changed, 1649 insertions(+), 1096 deletions(-) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json => gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json} (52%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json => gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json => gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json} (56%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json => gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json => gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json} (55%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json create mode 100644 packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json => gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json} (51%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming) => gpt-4o-2024-08-06 (streaming + generateObject)}/add paragraph and update selection_1_c6fb82e817b9dad69fb7d7369cac5784.json (62%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json create mode 100644 packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json => gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json} (59%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json => gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json => gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json => gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json} (56%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json => gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json} (56%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json => gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json} (52%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json => gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json} (55%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json => gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json} (55%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json => gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json => gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming) => gpt-4o-2024-08-06 (streaming + generateObject)}/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming) => gpt-4o-2024-08-06 (streaming + generateObject)}/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json => gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/{gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json => gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json} (54%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index 44ff578076..bb4ef99a73 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -45,8 +45,8 @@ vercelAiSdkRoute.post("/streamText", async (c) => { model, messages: convertToModelMessages(messages), tools: { - operations: tool({ - name: "operations", + applyDocumentOperations: tool({ + name: "applyDocumentOperations", inputSchema: jsonSchema(streamTools), outputSchema: jsonSchema({ type: "object" }), }), @@ -68,7 +68,7 @@ vercelAiSdkRoute.post("/streamObject", async (c) => { const stream = partialObjectStreamAsToolCallInUIMessageStream( result.fullStream, - "operations", + "applyDocumentOperations", ); return createUIMessageStreamResponse({ stream }); @@ -85,7 +85,10 @@ vercelAiSdkRoute.post("/generateObject", async (c) => { schema, }); - const stream = objectAsToolCallInUIMessageStream(result.object, "operations"); + const stream = objectAsToolCallInUIMessageStream( + result.object, + "applyDocumentOperations", + ); return createUIMessageStreamResponse({ stream }); }); diff --git a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts index 623772b37e..28cdf5c613 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts @@ -49,8 +49,8 @@ vercelAiSdkPersistenceRoute.post("/streamText", async (c) => { const { id, promptData, streamTools, lastToolParts } = await c.req.json(); const tools = { - operations: tool({ - name: "operations", + applyDocumentOperations: tool({ + name: "applyDocumentOperations", inputSchema: jsonSchema(streamTools), outputSchema: jsonSchema({ type: "object" }), }), diff --git a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts index 437ce912e8..1dd8ac7b9b 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts @@ -169,7 +169,7 @@ export function createAddBlocksTool(config: { }, // Note: functionality mostly tested in jsontools.test.ts // would be nicer to add a direct unit test - execute: async function* (operationsStream) { + executor: () => { // An add operation has some complexity: // - it can add multiple blocks in 1 operation // (this is needed because you need an id as reference block - and if you want to insert multiple blocks you can only use an existing block as reference id) @@ -181,108 +181,113 @@ export function createAddBlocksTool(config: { const referenceIdMap: Record = {}; // TODO: unit test - for await (const chunk of operationsStream) { - if (!chunk.isUpdateToPreviousOperation) { - // we have a new operation, reset the added block ids - addedBlockIds = []; - } + return { + execute: async (chunk) => { + if (!chunk.isUpdateToPreviousOperation) { + // we have a new operation, reset the added block ids + addedBlockIds = []; + } - if (chunk.operation.type !== "add") { - // pass through non-add operations - yield chunk; - continue; - } + if (chunk.operation.type !== "add") { + // pass through non-add operations + return false; + } + // throw new Error("test error"); + const operation = chunk.operation as AddBlocksToolCall; - const operation = chunk.operation as AddBlocksToolCall; + const jsonToolCall = await config.toJSONToolCall(editor, { + ...chunk, + operation, + }); - const jsonToolCall = await config.toJSONToolCall(editor, { - ...chunk, - operation, - }); + if (!jsonToolCall) { + return true; + } - if (!jsonToolCall) { - continue; - } + if ( + chunk.isPossiblyPartial && + isEmptyParagraph( + jsonToolCall.blocks[jsonToolCall.blocks.length - 1], + ) + ) { + // for example, a parsing just "
    " would first result in an empty paragraph, + // wait for more content before adding the block + return true; + } - if ( - chunk.isPossiblyPartial && - isEmptyParagraph( - jsonToolCall.blocks[jsonToolCall.blocks.length - 1], - ) - ) { - // for example, a parsing just "
      " would first result in an empty paragraph, - // wait for more content before adding the block - continue; - } + for (let i = 0; i < jsonToolCall.blocks.length; i++) { + const block = jsonToolCall.blocks[i]; + const tr = editor.prosemirrorState.tr; - for (let i = 0; i < jsonToolCall.blocks.length; i++) { - const block = jsonToolCall.blocks[i]; - const tr = editor.prosemirrorState.tr; + let agentSteps: AgentStep[] = []; + if (i < addedBlockIds.length) { + // we have already added this block, so we need to update it + const tool = await config.rebaseTool(addedBlockIds[i], editor); + const steps = updateToReplaceSteps( + { + id: addedBlockIds[i], + block, + }, + tool.doc, + false, + ); - let agentSteps: AgentStep[] = []; - if (i < addedBlockIds.length) { - // we have already added this block, so we need to update it - const tool = await config.rebaseTool(addedBlockIds[i], editor); - const steps = updateToReplaceSteps( - { - id: addedBlockIds[i], - block, - }, - tool.doc, - false, - ); + const inverted = steps.map((step) => step.map(tool.invertMap)!); - const inverted = steps.map((step) => step.map(tool.invertMap)!); + for (const step of inverted) { + tr.step(step.map(tr.mapping)!); + } + agentSteps = getStepsAsAgent(tr); + // don't spend time "selecting" the block as an agent, as we're continuing a previous update + agentSteps = agentSteps.filter( + (step) => step.type !== "select", + ); + } else { + // we are adding a new block, so we need to insert it + const mappedReferenceId = + operation.position === "after" + ? referenceIdMap[operation.referenceId] + : undefined; - for (const step of inverted) { - tr.step(step.map(tr.mapping)!); + const ret = insertBlocks( + tr, + [block], + i > 0 + ? addedBlockIds[i - 1] + : mappedReferenceId || operation.referenceId, + i > 0 ? "after" : operation.position, + ); + addedBlockIds.push(...ret.map((r) => r.id)); + agentSteps = getStepsAsAgent(tr); } - agentSteps = getStepsAsAgent(tr); - // don't spend time "selecting" the block as an agent, as we're continuing a previous update - agentSteps = agentSteps.filter((step) => step.type !== "select"); - } else { - // we are adding a new block, so we need to insert it - const mappedReferenceId = - operation.position === "after" - ? referenceIdMap[operation.referenceId] - : undefined; - const ret = insertBlocks( - tr, - [block], - i > 0 - ? addedBlockIds[i - 1] - : mappedReferenceId || operation.referenceId, - i > 0 ? "after" : operation.position, - ); - addedBlockIds.push(...ret.map((r) => r.id)); - agentSteps = getStepsAsAgent(tr); - } + if (agentSteps.find((step) => step.type === "replace")) { + // throw new Error("unexpected: replace step in add operation"); + // this is unexpected but we've been able to see this when: + // adding a list item, because
        first gets parsed as paragraph, that then gets turned into a list + } - if (agentSteps.find((step) => step.type === "replace")) { - // throw new Error("unexpected: replace step in add operation"); - // this is unexpected but we've been able to see this when: - // adding a list item, because
          first gets parsed as paragraph, that then gets turned into a list + for (const step of agentSteps) { + if (options.withDelays) { + await delayAgentStep(step); + } + editor.transact((tr) => { + applyAgentStep(tr, step); + }); + options.onBlockUpdate?.(addedBlockIds[i]); + } } - for (const step of agentSteps) { - if (options.withDelays) { - await delayAgentStep(step); + if (!chunk.isPossiblyPartial) { + if (operation.position === "after") { + referenceIdMap[operation.referenceId] = + addedBlockIds[addedBlockIds.length - 1]; } - editor.transact((tr) => { - applyAgentStep(tr, step); - }); - options.onBlockUpdate?.(addedBlockIds[i]); } - } - if (!chunk.isPossiblyPartial) { - if (operation.position === "after") { - referenceIdMap[operation.referenceId] = - addedBlockIds[addedBlockIds.length - 1]; - } - } - } + return true; + }, + }; }, }); }; diff --git a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts index 9fc3e85ba6..2bd41b1e00 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts @@ -8,12 +8,7 @@ import { } from "../../../prosemirror/agent.js"; import { updateToReplaceSteps } from "../../../prosemirror/changeset.js"; import { RebaseTool } from "../../../prosemirror/rebaseTool.js"; -import { - Result, - StreamTool, - streamTool, - StreamToolCall, -} from "../../../streamTool/streamTool.js"; +import { Result, streamTool } from "../../../streamTool/streamTool.js"; export type UpdateBlockToolCall = { type: "update"; @@ -172,13 +167,7 @@ export function createUpdateBlockTool(config: { }, // Note: functionality mostly tested in jsontools.test.ts // would be nicer to add a direct unit test - execute: async function* ( - operationsStream: AsyncIterable<{ - operation: StreamToolCall[]>; - isUpdateToPreviousOperation: boolean; - isPossiblyPartial: boolean; - }>, - ) { + executor: () => { const STEP_SIZE = 50; let minSize = STEP_SIZE; const selectionPositions = options.updateSelection @@ -187,81 +176,85 @@ export function createUpdateBlockTool(config: { to: trackPosition(editor, options.updateSelection.to), } : undefined; + return { + execute: async (chunk) => { + if (chunk.operation.type !== "update") { + // pass through non-update operations + return false; + } - for await (const chunk of operationsStream) { - if (chunk.operation.type !== "update") { - // pass through non-update operations - yield chunk; - continue; - } - - const operation = chunk.operation as UpdateBlockToolCall; - if (chunk.isPossiblyPartial) { - const size = JSON.stringify(operation.block).length; - if (size < minSize) { - continue; + const operation = chunk.operation as UpdateBlockToolCall; + if (chunk.isPossiblyPartial) { + const size = JSON.stringify(operation.block).length; + if (size < minSize) { + return true; + } else { + // increase minSize for next chunk + minSize = size + STEP_SIZE; + } } else { - // increase minSize for next chunk - minSize = size + STEP_SIZE; + // reset for next chunk + minSize = STEP_SIZE; } - } else { - // reset for next chunk - minSize = STEP_SIZE; - } - // REC: we could investigate whether we can use a single rebasetool across operations instead of - // creating a new one every time (possibly expensive) - const tool = await config.rebaseTool(operation.id, editor); + // REC: we could investigate whether we can use a single rebasetool across operations instead of + // creating a new one every time (possibly expensive) + const tool = await config.rebaseTool(operation.id, editor); - const fromPos = selectionPositions - ? tool.invertMap.invert().map(selectionPositions.from()) - : undefined; + const fromPos = selectionPositions + ? tool.invertMap.invert().map(selectionPositions.from()) + : undefined; - const toPos = selectionPositions - ? tool.invertMap.invert().map(selectionPositions.to()) - : undefined; + const toPos = selectionPositions + ? tool.invertMap.invert().map(selectionPositions.to()) + : undefined; - const jsonToolCall = await config.toJSONToolCall(editor, chunk); - if (!jsonToolCall) { - continue; - } + const jsonToolCall = await config.toJSONToolCall(editor, { + ...chunk, + operation, + }); + if (!jsonToolCall) { + return true; + } - const steps = updateToReplaceSteps( - jsonToolCall, - tool.doc, - chunk.isPossiblyPartial, - fromPos, - toPos, - ); + const steps = updateToReplaceSteps( + jsonToolCall, + tool.doc, + chunk.isPossiblyPartial, + fromPos, + toPos, + ); - if (steps.length === 1 && chunk.isPossiblyPartial) { - // when replacing a larger piece of text (try translating a 3 paragraph document), we want to do this as one single operation - // we don't want to do this "sentence-by-sentence" + if (steps.length === 1 && chunk.isPossiblyPartial) { + // when replacing a larger piece of text (try translating a 3 paragraph document), we want to do this as one single operation + // we don't want to do this "sentence-by-sentence" - // if there's only a single replace step to be done and we're partial, let's wait for more content + // if there's only a single replace step to be done and we're partial, let's wait for more content - // REC: unit test this and see if it's still needed even if we pass `dontReplaceContentAtEnd` to `updateToReplaceSteps` - continue; - } + // REC: unit test this and see if it's still needed even if we pass `dontReplaceContentAtEnd` to `updateToReplaceSteps` + return true; + } - const inverted = steps.map((step) => step.map(tool.invertMap)!); + const inverted = steps.map((step) => step.map(tool.invertMap)!); - const tr = new Transform(editor.prosemirrorState.doc); - for (const step of inverted) { - tr.step(step.map(tr.mapping)!); - } - const agentSteps = getStepsAsAgent(tr); + const tr = new Transform(editor.prosemirrorState.doc); + for (const step of inverted) { + tr.step(step.map(tr.mapping)!); + } + const agentSteps = getStepsAsAgent(tr); - for (const step of agentSteps) { - if (options.withDelays) { - await delayAgentStep(step); + for (const step of agentSteps) { + if (options.withDelays) { + await delayAgentStep(step); + } + editor.transact((tr) => { + applyAgentStep(tr, step); + }); + options.onBlockUpdate?.(operation.id); } - editor.transact((tr) => { - applyAgentStep(tr, step); - }); - options.onBlockUpdate?.(operation.id); - } - } + return true; + }, + }; }, }); }; diff --git a/packages/xl-ai/src/api/formats/base-tools/delete.ts b/packages/xl-ai/src/api/formats/base-tools/delete.ts index d876865323..69642a9ddb 100644 --- a/packages/xl-ai/src/api/formats/base-tools/delete.ts +++ b/packages/xl-ai/src/api/formats/base-tools/delete.ts @@ -76,32 +76,34 @@ export const deleteBlockTool = ( }, // Note: functionality mostly tested in jsontools.test.ts // would be nicer to add a direct unit test - execute: async function* (operationsStream) { - for await (const chunk of operationsStream) { - if (chunk.operation.type !== "delete") { - // pass through non-delete operations - yield chunk; - continue; - } + executor: () => { + return { + execute: async (chunk) => { + if (chunk.operation.type !== "delete") { + // pass through non-delete operations + return false; + } - const operation = chunk.operation as DeleteBlockToolCall; + const operation = chunk.operation as DeleteBlockToolCall; - const tr = editor.prosemirrorState.tr; + const tr = editor.prosemirrorState.tr; - removeAndInsertBlocks(tr, [operation.id], []); + removeAndInsertBlocks(tr, [operation.id], []); - const agentSteps = getStepsAsAgent(tr); + const agentSteps = getStepsAsAgent(tr); - for (const step of agentSteps) { - if (options.withDelays) { - await delayAgentStep(step); + for (const step of agentSteps) { + if (options.withDelays) { + await delayAgentStep(step); + } + editor.transact((tr) => { + applyAgentStep(tr, step); + }); + options.onBlockUpdate?.(operation.id); } - editor.transact((tr) => { - applyAgentStep(tr, step); - }); - options.onBlockUpdate?.(operation.id); - } - } + return true; + }, + }; }, }); diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json deleted file mode 100644 index 437b895981..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/Add heading (h1) and code block_1_0e5edfd25f60308e612767de12847e8d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_016MRgf9GPFVrnUEhg1BtKgq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01E21HvW6wNrk5DENFt89MuC\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

          Code

          \",\"
          console.log('hello world');
          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1090,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":107,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json deleted file mode 100644 index ba921e1289..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_5ae3e0eff0dfe69a51f4572ed04f7e59.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01XWt3QnGdaqrMDPp7Crcq9M\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01RqpXkdfTvXVvLpwQskiMRh\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"
          • Apples
          \",\"
          • Bananas
          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1076,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":100,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json deleted file mode 100644 index 9c41a7a7f3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_96826a43db728a07477682898c006eec.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01GD4fNgbtX2yxfNkTBt3yPf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01B1HzBSURHdmqe1y958noGd\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          You look great today!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1039,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json deleted file mode 100644 index 9f14155fe2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (end)_1_c1da093b93c714a83bb7c0d1ddd97412.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01UYUx983MVwLLuGKRzJUYds\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_018x9BwMKvVrqr5QAsCW3QSX\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"after\",\"blocks\":[\"

          You look great today!

          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1071,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":79,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json deleted file mode 100644 index 28da6b70b1..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (start)_1_be93e9492f5031d7a78c65393f7a1d75.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01R6ZPAtjopupbxGs9PKQkEn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012BB8261m9mnM2jWPiZPXfC\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"before\",\"blocks\":[\"

          You look great today!

          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1071,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json new file mode 100644 index 0000000000..6d1a1340e3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015BTLnGhPJTt3V9PYba2c6a\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1131,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a heading and a JavaScript code block\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" at the end of the \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"document. Since the cursor is between\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" blocks, and you want to add content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"at the end of doc\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll add the content after the last\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" block (which is \\\"How are you?\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01MytcKtGUwEZyxZuEHiRoyf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"add\\\",\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eferenc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"position\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"after\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"blocks\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":[\\\"

          Co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"de\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"
          c\"}   }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\"}        }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sole\"}            }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\".log('he\"}     }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo world'\"}       }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");
          \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1131,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":194} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json new file mode 100644 index 0000000000..1e4272b255 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01J2aYGPqbGiqroxyLBQWDSU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1117,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll add a list\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with the items 'Apples' an\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d 'Bananas' after the last sentence\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" in the document.\\n\\nLooking at the document,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last sentence is \\\"How\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you?\\\" which has the ID\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"ref2$\\\". I'll\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" add the list items right after this block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01C2zXZqLkoQJ1mBQFyMnTeU\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"refere\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nceId\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"fter\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"cks\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"
            Apples\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"
            Banana\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s
          \\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1117,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":197} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json new file mode 100644 index 0000000000..52891229b6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Vu2okK4c9HSrEVTMdq1HbW\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1080,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"'ll add a paragraph with the text '\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"You look great today!' to your document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nSince the document is currently empty (\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"with just an empty paragraph), I'll update\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" that empty paragraph with your text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QsKzZ1bj87dETchhwPJudH\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

          You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

          \\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1080,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":141} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json new file mode 100644 index 0000000000..345b34a975 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CDDtLqfzeeN5j4bdFtN9uy\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"'ll add a new paragraph with the\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" text \\\"You look great\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" today!\\\" after the last sentence in the document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nLooking at the document,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last sentence is \\\"How\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you?\\\" in the block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with id \\\"ref2$\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll add a new paragraph after this block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01KE2jD22EBrDiQtu4ziQYHz\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erence\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"po\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sition\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"after\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ks\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":[\\\"

          You \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oday!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":168} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json new file mode 100644 index 0000000000..cd1dbc94af --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01DEbbq79ZSAEfyX2DpGyjqb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph with the text 'You look\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" great today!' before the first sentence in the \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"document.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017W8cfvFa9ojoRLt5n7Wjwr\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ferenceId\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\\\",\\\"pos\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ition\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"before\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ocks\\\":[\\\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"You look g\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":134} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json new file mode 100644 index 0000000000..7896e32abb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm8n9ffq9j5q47s08yne2\"}}\n\ndata: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"p41eh3gjz\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"blocks\\\":[\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language='javascript'\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm8n9ffq9j5q47s08yne2\",\"usage\":{\"queue_time\":0.252781728,\"prompt_tokens\":829,\"prompt_time\":0.080379153,\"completion_tokens\":79,\"completion_time\":0.166194275,\"total_tokens\":908,\"total_time\":0.246573428}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json new file mode 100644 index 0000000000..da63a8479d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm870e10r85ahk7q2dbah\"}}\n\ndata: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xfs80gfyq\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm870e10r85ahk7q2dbah\",\"usage\":{\"queue_time\":0.198740233,\"prompt_tokens\":813,\"prompt_time\":0.069264736,\"completion_tokens\":57,\"completion_time\":0.120678635,\"total_tokens\":870,\"total_time\":0.189943371}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json new file mode 100644 index 0000000000..501121e2df --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm97ke11sb197qfekc8pe\"}}\n\ndata: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"3fmxjk98m\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm97ke11sb197qfekc8pe\",\"usage\":{\"queue_time\":0.095475298,\"prompt_tokens\":782,\"prompt_time\":0.06538052,\"completion_tokens\":35,\"completion_time\":0.088602443,\"total_tokens\":817,\"total_time\":0.153982963}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json new file mode 100644 index 0000000000..264120acde --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp12c9ekesddqwr19cna36\"}}\n\ndata: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"mv8nh3fvk\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp12c9ekesddqwr19cna36\",\"usage\":{\"queue_time\":0.143742763,\"prompt_tokens\":811,\"prompt_time\":0.065693101,\"completion_tokens\":41,\"completion_time\":0.090027569,\"total_tokens\":852,\"total_time\":0.15572067}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json new file mode 100644 index 0000000000..358c74f414 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm7dve0zrsq3r8ekwwjn0\"}}\n\ndata: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1vprdxh9b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm7dve0zrsq3r8ekwwjn0\",\"usage\":{\"queue_time\":0.085546031,\"prompt_tokens\":811,\"prompt_time\":0.066794994,\"completion_tokens\":41,\"completion_time\":0.096887744,\"total_tokens\":852,\"total_time\":0.163682738}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json deleted file mode 100644 index 8b959651ec..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/Add heading (h1) and code block_1_4fd0655be71caae6b7983603e51af51c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29aeffcc81948e54bc90ff83c09406cf2fb3776eea90\",\n \"object\": \"response\",\n \"created_at\": 1758144943,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29af6e3481948ad9956f74d29b2406cf2fb3776eea90\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 624,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 55,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 679\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json deleted file mode 100644 index f297c55be0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_db7fbffbd0451f36b760272fc5d21981.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29ab68c8819497de19666ce3d2580fe23418815ede05\",\n \"object\": \"response\",\n \"created_at\": 1758144939,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29ac1efc8194b98e55dca80fd5e00fe23418815ede05\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 608,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 50,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 658\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json deleted file mode 100644 index c1197dc97f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_ec679341141937cec2df7a1a2a6719ba.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29b0b13c81948c3348fdcd1dc43908216564ab3df493\",\n \"object\": \"response\",\n \"created_at\": 1758144944,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b1bb9c8194a0767590e8618e8308216564ab3df493\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 578,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 606\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json deleted file mode 100644 index 6ea7c5223c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (end)_1_e92ffb458c4c624adaf290660d5e7773.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29a9cb148197a48a2281e363a27c01c7ce689ddd2f40\",\n \"object\": \"response\",\n \"created_at\": 1758144937,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29aa873c8197a99b77ea9da8333601c7ce689ddd2f40\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 640\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json deleted file mode 100644 index 5484bc6b91..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (start)_1_7d5253a97f3f342003e32ab92acfff29.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29a81490819780867fe7f7528d9104baaf1b18b7b3d3\",\n \"object\": \"response\",\n \"created_at\": 1758144936,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29a89e8c8197b1acd75feb0b898604baaf1b18b7b3d3\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 606,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 640\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json index 6ab0bf804d..a8287c61c9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_3139b296f45dc96c7f91c1f262392d80.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ao9fjKE74idUq2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"YFEfiq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"h20PwbdOT4got\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qTNS2FCnbXyIvJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ysM0gSxD4qr7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CBvhOTqhumy3c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"s4O6yrgugSKOt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yU78cgCagfJpC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"Zl9j0S2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"xkDbKO8Z250aC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PNwzA00896RXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"I4Ambu22OnyyP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"HPdUag1qDpZpinX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"uT521vRWkNSCi7E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cuEdc0iOMgm4c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"nvHSlTRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XJDh3M5zewwDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"TUZhCjfEMTR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u2mKFBos3u0bz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6ESN41WyvY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"FkmYRuELCdHX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uBGHlh1ROkuzpnS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"Z9NKw8vySdHjOuE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KVLyFriInufK09o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MQUKJHIpjJ8bidj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"JznnR9sSqiF0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"6pjmJ8gy6SE7Y0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"b2DYauBOl4yry\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uhA2O81dpShikyn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"UJcTXQGbOYNCk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"nwKPnaTogU4oDg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"ksC38gSGv1yk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"K1njiBTTXoZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"ls17qbd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Cprq8BGoETeja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"44MYJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"3xR9Gd4uu22mK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"nO5U1swol\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"EWZkJP55Hf5d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"0yFMXUqKkY4nK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"2lh4CDkz7CD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"OeekOWcN5B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"5FMgjL0Sy6RS8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"md1iNW2GNVuU2C9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"OOwHd12yXDWcyy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"KxTXtHuEAJ5BB0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"PKVtCJt8R4Xjwy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68cb298507808195ba3d1a118a61ae810c5941d7da4bf397\",\"object\":\"response\",\"created_at\":1758144901,\"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_68cb2985864c8195831ea1643e0a349e0c5941d7da4bf397\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":624,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":679},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lLDS70dEpZn1h3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"tGAQBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"TEIwwKOvE6Fac\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dtqU7OP0wUSfuu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"cXwVeOtrj2TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x6QTvSjQXgxAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"zariir5eovXWj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8ujegY778WaIe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"oxPmtqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ssG21khGeO9GoO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GDYCDNWdhRW3F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FaS5iQ4JI7tZn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"W29Yrc87i0pjIzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fYWCCerpDwqeX1x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rQAR1U0sktKpT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"3MW2sBMN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B8ccwQ2aamnnH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"bb1I1KuORAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"c8dRLkteDyI3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"YjMKKwnMKI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"onjXFR3581BC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"p7e04PxPKuFrt0w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"GzKI7kuxQ8OVs8e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sbAlS0bQMYYAwp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"AwUF4BLJrIDZoTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"0oum2oxQnQdV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"HuH6ej7TDfZSIXX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"srlXzteyhzAEN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uD687CAXhxSHG16\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"hO2OoTdF0cJZK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"1SvvlkNPttw0yQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"YJ3nF1UuQCDc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"i0sKvB1mrzU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"a11VHJt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"H7549kG6sojeg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"d1DOx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"jE5c5kaOejSJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"X0svLeb14\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"FV1a7BnTGu5E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"fqv8y2i7CTkbv7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"ICyzWuXgSip\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"yyMLBmU8cd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"9oM5GtLg4VseT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dSZZs4fg7FGaqJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"eQRnSwFUVA4xgA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"R9N97nBTkMCCgnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"9blpebQtLPRjqE\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\",\\\"
          console.log('hello world');
          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json index 4d9da3f35c..29154366bd 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_97ee12aa97bd6b477bbea182b59027ed.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Duau6an9JmCwhn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1rmO2a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZZHLEv76Mig6C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YuszvzBLIrYhiL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"C5Vt7W9EEybW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"q22v6w286mr19\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"D6Ez13YYR9BNH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qLAHNhpdf1j9d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"hRkvym7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ZPhydmySHdEYpk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PmhwQ1D0hKFUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9PvDubjwkgLui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"CrrBybYGE7zv3jQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nL6kA2d77e1TO99\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3pMy0waF9kkoH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"TYdowxvw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w09pytTCFQAKI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"LEywhFebAqR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"l8AJRnH5DUQjz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"N2Zi1rudnl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"t8JqbBk7KKzN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QLWl1fJoZ1J12CB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"oNfxNZguKNVpl5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"O1yXeidPABGGRS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"UrXVx7gBSCtcCa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0j0Kx9AbsfFUaKg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"hf18hcWmCJI6oW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"PY6HjCrPI0cr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"CLuejcxKVnKAKDo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SyTUDxirKE08U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"mATXu7onQIXuW4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"k0jp31wBszkxAv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"vexwPTszU0GYFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"TUdtrBl4qqekt8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"1AGembRFYVkWuUz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"oRoUNOD3TqGsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"mXBmHmp5emN6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2eeKRq0qI0oH0Xc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"tidmDo146DWBuw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"zVsRjBSvCcfJ88p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"dS3tdEO43MJldh\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68cb29835c708195b7d7968bf1eaf3ca059dd91451c09887\",\"object\":\"response\",\"created_at\":1758144899,\"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_68cb2983dca88195944b29834f508d2e059dd91451c09887\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":608,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":658},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fKJUDWzVplehKc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TAJ8I7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"OSHyb8PYZRlIG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2YmgvSdoczzTmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BRfHvyyVqKHT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"k5iGRBKNtG9tJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"2cj3RWRJr3WWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3xe2uAKqpayew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"suUbTcR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"6jM6g1ENkQy1Tb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ew2q93Y6WBML1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LpLucnP9JxHSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"I9wTPBUA8ccH3co\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NcxJaddy9mLeUtH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4BO8AeLG6p1Uu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"H9hcubn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l44O1Xj75xFWB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"bFGcpUAjTfM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bcR3pRQegJlCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"DK2R6SROUY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"whVDJf1a33OL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GT5K6y0EgVHxXor\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"AkRBZMpcpVYY7x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"flFlxAwUoX2Cz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"RByof0gIiYwqTp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"lvTA34f1XeFwCFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"UPzYaHV9frob6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"HSHetRGgMRoN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JQH2xO7yRk7YiPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8yu4CWgbxsq5x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3tW5iKSbdYxrPb8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"QuqtJSa7gWkKTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Dp9sSyYFSHfNix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"JzrO4T4pSuOj1C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"qBK3xpmFBUACJVY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"gdQATPG6DsWJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"nrztHxdy1Dj4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JvzpkiFnPvisCdm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"fTCulMknWVp0dO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"mIgMm5ih07KDzDR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jdtSWZg0eAJaaD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json index c99aa8acd7..a95ad8be64 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_267cf59e7bb9211754c08ea1f656d7ae.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cjuGNSp3ytCqoG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"uUrPmo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CVlLlEpfSirCY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"anZxtNGUzqXvkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Cu976WYOYwVs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"26fTgYbySgEoi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"TfVYbI1C6k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Aean7QiqycPd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UNzYhSQlsd6WRy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yBOv3Qy04za97\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"c3zsZo6crD3Xu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"dtDqPWHLWijtkEc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"grWwBcNTTVDdU6F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HZFGxS7mM8Ffh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"1DPcoEAxhyE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8RAOG0BqGO7zw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"TsUrx559ktQkoSi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ZKVsDVwLdwj0YRK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"Ddzno27piG13\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"Icy0BPVRCjj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"bKbIJT5yq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xcTdGWTkCB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0kL1mwM2tqSn5gq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ydc1SOonllXfRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ckAsfLEkYDZ2dk\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2986c6808194ba976c14bf377a760f1e2fa273e67b38\",\"object\":\"response\",\"created_at\":1758144902,\"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_68cb298750588194b4107622248390f90f1e2fa273e67b38\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":578,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":606},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FqbAjG961vQDRm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cY8zC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"xqdNjNmxJUrMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"frK5me0VsFqWtl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GqOTFhh5Xsa8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Mj1SxJcnHe80n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CeDpXab6b4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ktYnDd5KH6luE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Z8Gmh4eAYY7dB8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FjA7aidHMkTJR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fcjKJK7mvmZ6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"l2Fs7hMEiZ6IoPz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MQ49TkQcKk1RQYP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"M3UYu7vMQuzDA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"VcRvAeN03dh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tRdzO8RIALh5n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"eFGR61m5dMQiHif\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XijVtfePA3RbOWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"DhCGokCjAP0s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"4FeTUTCWRaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ZZLBGSTLqE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"hOUnhaNEOO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"L2vYAqBK1BL7R1b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Wnxnrbxzsg5Cti\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"Y4Vdi1xieZAKjJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":586,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":614},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json index 3faa3a4361..7fd5a03b38 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_a1b15f4c24e8bc5602ed133a0bfc5573.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OfIG6yYPUvIjUw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0D75Tr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"aizEDN4KqCI4r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rZiIVYQHkpliFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"s0e4itYimxUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B0aA7Q0waXtws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"p3UpA8YNkozPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bEiUCtmwobPEm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"dSQOJPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"noXtgsdaD2fFbU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NDJG8teUcj38R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yWEFy1MTZf7bC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"cYxMnb9QxUQjKLl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"iwuIP8Y2OjiWVzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SGC8tdzg7ly1F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"PvTpIutb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l2XsecAephEHO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"OUpfGoIKz3k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"g60hbZBCSqBZd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"m2KaKJzmEZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"BWF3mmDwc5n6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rP8wIlkLEjeQb2f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"DGR6Z4YhHVtNT9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"1HJdu6xtIuDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"dup2keI4aqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"TrmBarGQ7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"rUqYGtIbpj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xatNrBEgNXoPNee\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2hec8Jdfuhl3vy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"62OY0oGQS7NHSlr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"de9QEFpeRNsUfU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb2981933881978b5549b4f7346962006e0aef1959526d\",\"object\":\"response\",\"created_at\":1758144897,\"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_68cb2982553c81979d28b4e191293fbb006e0aef1959526d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":640},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"sTxreD4V68a0Nt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"BZg6M6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HT5vLn99KVVRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AADFv5u9dYAdWK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"fNz0E0xYs90N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"USTZqQqO6V1qJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"eId95c7aU1yXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3r4IfZKz4i2fj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"I3QAgmP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Zuvz5PlmgBcZK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CPUHupl7fSadz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JcP2dbuwu61iH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"1Rm0K9AX3xl4RV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MnpYtdyiXvnA4wi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fUXnW0rkbNFW5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"HcOwLwHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nXekkAVJw3W6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"s9260hknmL4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jPqXWpgB9lgFh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"5mNvldmVKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"mkwN4TpwuaND\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"C6icdOuj00soMkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bu95II6D2NFMx64\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ninVZAK3BeD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"ojJDN2bIPn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ZIy8cMZTNB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"3rrsF34bp2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xk4VtVwNLneGqzm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"nK0hQVv4Dc9jn2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"VnElsREihiiUQYs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"7GQY1vYmgQb4TV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json index 59fa1e7d55..0dc55be281 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_27593d2fa262011d9360c89049abc9a0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"kr4Sihq7PEoivl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DVOrdc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Uvpa5yqXeEfUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uODfdziEooT99L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"aQn84vN2YqAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EwBxlHjicNff5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"BVoZZxqbs0UJe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6QyYAns3lpXo7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"WztLWAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"qWIr8Z7BbncgSw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qrnHSNGJizVaH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"PXKTqtQzenDRZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"FYzL4LhIu8WuW2t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OrSAmOca7KXOujb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"AFNXuJFg3DwAI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"3fWEVbk2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uBau2DjfeFOEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"uxA1Thmg9y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dkgq8OucQgB4D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"cEwBShvE44\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"BJMJRH4UBzoe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GOtRBGv5xw95HNL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"o98SzGmGvlwYgfd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"JCOvrVHFVT0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"gL4TEYW6lqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"vCB3SIswwz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"3thhKT61TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Slepv8qSWSu9BK2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"VPx6QXaNC0g669\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"8P1VAN1lJRz0Ofe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"GY8FTK8xDSeENv\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb297fe7cc8194b8ae9c432c7d0d3709c079e83a799951\",\"object\":\"response\",\"created_at\":1758144895,\"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_68cb2980994c819493410629d4131bbb09c079e83a799951\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":606,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":640},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6iq2kLAQS2Np9f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TTWOFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ym6ydhfUK69Bf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GQJycLr6p0g598\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"PxY7hKxeeqY1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JXY2fwVw5JTF2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"TkHufNbQqAmko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wiOzj4NFOKOed\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"GEO7xCL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"OnwDOLpAQul2Ok\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"t0XBjxv5gfz3O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Uyh1kA3E3Ku3y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"byIB2Ye7xzPlApK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HGcI6X5XdUJbh1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nUcvYTxwKNe4g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"r4XxFqmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MpuHi5ubWlZKB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"DwKlKNIUbZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OZzdAc3Ovwn0v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ln3NdVaWzf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7SGv8D5nrIRg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UWcvwuKowySiMyf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"krImvP9Zt4fkqJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"qhxzVtZuHdof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"75V3OqDmHxx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"cPCU2fUEzD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"fc5Okr3wzv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"t6ZItHldoT2zN4d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"a1UEj2A9gDJhsf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"iiW2ZhygQHNRphZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nDsomrUhjUvJSZ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json new file mode 100644 index 0000000000..2c16a6ff53 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JAh6YSZJGw86r0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"quUAa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"DjO15r1CWhIiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"cMn3Ch2GmDS2FXk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"ArrUddifDlZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"q2jy7uU2112yIz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"PuBjPYgmc0ay\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"FQh4CxrtJCTszz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"oM3D9C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"nX26scAWGA5lAr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"OWiveemfflJ11u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"4QGvOO0gNiwf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"6plBw4dXyzThFsp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"oHXOpCBElh4i4mY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"3FKvf67m38ME5V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"nLzwskn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"LDuiuOfRHjQCk2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"after\",\"obfuscation\":\"OTqQyFtq8U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"VIDIEv2ClnzIWM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"vts08SW0I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9iHVmrMld6NTB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"z1OxmER5jzvvLb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"EqoyTRiy79mmf0o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"GRWDeObxt3Z0SpC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"28DknyOl3XIiLVg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"Code\",\"obfuscation\":\"JLb5HrXqnTrx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"j3TX8ReIr1wU5wh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"aMKcpK7q1OH5yU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"7ep72xxfk7fLa9D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"DJcgrzu5E5H8iY\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\"]}]}\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"0mjPwrAB5QF4LU9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"hz2RY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"4OQVRnoJZZ9sB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"oOfSTysekZWHsAd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"1XscejVV7DC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"lrK9ZAXV3WHG4r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"add\",\"obfuscation\":\"9LIXxXMEn16l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"KLASRmtFUuOvkQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"reference\",\"obfuscation\":\"xgp34h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"Id\",\"obfuscation\":\"bRVt8ZuEkEtdxN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"6xaiA2RmnjOfbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"uqxda9IvwUcv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"hPLKajTtWlcN4MY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"zIgzfZ6cT77gcTJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"akv05VdcA3ZGSy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"position\",\"obfuscation\":\"FEfdp4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"nvHtfPcKPwsMzk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"after\",\"obfuscation\":\"DfxNLWXEgw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"YCY6jkAJvf9zsC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"blocks\",\"obfuscation\":\"qQDM7NnGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"cWgZRu9m5Bv6b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"TQhZ79v71qg81h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"pre\",\"obfuscation\":\"uvTdz0Odf7gMM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"><\",\"obfuscation\":\"fXwtN9wykx0iwP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"code\",\"obfuscation\":\"uMtojKUKuzv6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"JwsQ70z3v7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"-language\",\"obfuscation\":\"QkmCGZ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"=\\\\\",\"obfuscation\":\"5U9TjGHNUu5CG5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"javascript\",\"obfuscation\":\"QwsID\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AGczCrASW1wBx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"console\",\"obfuscation\":\"ChwxAFz6k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\".log\",\"obfuscation\":\"3qPGrsvan9sO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"('\",\"obfuscation\":\"mgKUnxqVzwuNgz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"hello\",\"obfuscation\":\"qVPe1xtGUcA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\" world\",\"obfuscation\":\"WjUaskONiE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"');\",\"obfuscation\":\"RhgwUCvuaC2FA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"m1lHPhlrINupew3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"]\",\"obfuscation\":\"puvN2lZs7ryZ6q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"}]\",\"obfuscation\":\"Avs4Llpw2QvxEm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"GTr7T8X2hNsgcCm\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":83,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          console.log('hello world');
          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":84,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          console.log('hello world');
          \\\"]}]}\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":85,\"response\":{\"id\":\"resp_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"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_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          Code

          \\\"]}]}\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          console.log('hello world');
          \\\"]}]}\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":558,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":114,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":672},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json new file mode 100644 index 0000000000..9d08d4215c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"nLZfeaizMQeEqB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"bsBMML\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"tEuk7neHEJhDq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wn6QoA6yXe2rt8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"rWCi4wshFWAP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SEZq116tcczhK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"jJJMPSsexGgoi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hTpd9MtQRDlQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"73oGG12\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"x5nneohEfsWXs1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Q9RdVuxjEkwN0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"oPMc3Ku2Zgx17\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"U1QU6F3DRyhSzZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"3WcZa56Tpv5c2RA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"iuiC8eYNryYQe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"smnDDM3y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xvk8Iisvqz1my\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"AH2BUqPt0zc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"bazkC5KpXdptF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"FnGkAa90wn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"aGLclaUByRJx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"soRljLybboGCFKM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"QJS4tQabXLJ1iJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"ly0ni7nisjyNzb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"261mi9t7YahR8Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Cw8xIv8Mwaz0JyL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"xm0HgazYQ13VEM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"dut7w8aE0UQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"oV2erhgFvPTuZiM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Er1kwxhktcI3x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"so8ILnFNs2Ji2XJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"TtJt6LZRUSLS0Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"NUpsEFerIaXEc7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"wNdVgBV8zyPbvD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"1ptmE8k2QRPQM5m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"134JfPDXkPUvT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"TYeiGmM4Sz2y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"ie2U7l1j5XhyfFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"ZDP07tNSZ8NfEB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"rbHAH6F13eCXgCU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"u1LpLRWBiVoPgb\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":52,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"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_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
          • Apples
          \\\",\\\"
          • Bananas
          \\\"]}]}\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":543,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":60,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json new file mode 100644 index 0000000000..85407d124a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DKaooWSRF8bLSf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"MeThu5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RnMtQbJMvIOpb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mQAheo7SQNwoJH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Y0ypofTOrLJR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GyZrrxHTBM6fn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"P5gnZxardQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FoJkPhicKQioc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6AO646MpaxpYdN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nvxa4E0Nqtk4T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"lMc1RT9JGn5FT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"s92agGePHXiUtF9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"rnFiomeJA9b0dw9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9jpTfjhSt69dW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"KROfLej4phT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"62ocdQ8kldbUx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"P7zFeoZshiCufJ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"o7zAdYMFpU3MwJQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"9h7drK7NCgPD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"hNb8NZB51n3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"drrKQofW63\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"M9zZdGRYul\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"OXuD6wgpoN826RK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"D10szI0E3VKguU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"yFL7SRoADuQd8H\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"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_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          You look great today!

          \\\"}]}\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":513,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":551},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json new file mode 100644 index 0000000000..f491de5e4f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wVq34YZJmUqgQZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"ZW8C2g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"dTKXCEuG13IOU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"WdWe5oP3Wsx1su\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"WyBkMR5gMIm8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"U9pmP3YIfYhg7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"OPcEBpClq6L8L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hdTsPRHN4n6Vb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"0APCuNQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"vMdrr9MDnhC24L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"mjcCzOuDhm3Qm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"id2j7LRsc3W5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"Dfm4Zsh5QGABL4v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"TIIIUIbukh2BQiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Oa2UovaE9Xx7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"zXI2BIs5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"f5eKmmbiLb5bv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"v9IMiKtWogP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"OvlEi2svHoXWB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"luOKUmfV2b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"1VHJhJmcO2hG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"VtN0J77aaGG12jU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"rE9Xh8OkT7off0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"b45EQhf7xbsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"HwT6CerN6FZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"AV0aVkOTGs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"CR6K6pO4rb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"VDQvxwo3WC8GQ0r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"Ewvqq4MwVcBID3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"M4euajfPe36JX0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Fk5wAHfrB5AUBy\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"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_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":541,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json new file mode 100644 index 0000000000..19dabbeac0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ERAom8dEWRvprG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"30grEo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"4nJmFoocR9MY5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sAUFlA25q79zIf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"7RxFVITwJvbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hIBJ6TMWIj85p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"Qxvv9nzQCyKxX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SXnw2hwssChVD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"IUKd9u5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"3jONIA0OpiEM0f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VETxyrftx9jRP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"9fRLQ5nZboZKN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"0IkjcTdKbgk261o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"NTVM1M379WBYgr5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"H1fj49PtwYBqA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"aXoY0mxS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"huCxtWhICVIO8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"0pFDoZKn3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8JYhikW1YJUA9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"WNeEEgBuzB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"2vN8JZxOi0rU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"aVSdOAYViuO49b1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aiipuph7JtJvOSt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"xnTDiijTUJq2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"AiWWtAe518x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"gLgaSVOPdK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"FE3JeBau6B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"dNrAgq8sl2yLrQn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"nbf5o5KtXBOHxq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"uKIvMpv9jmepDBo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hZvKDx25OwY3FG\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"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_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":541,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json deleted file mode 100644 index a2de3fa6e9..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add and update paragraph_1_9c13225608eaccf4da63366cc1408a11.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01H7rc5DxdNA7b61Dqiy4B2k\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01VgkpCzApsSiy5Tfaw9ztDc\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hallo, wereld!

          \"},{\"type\":\"add\",\"referenceId\":\"ref1$\",\"position\":\"after\",\"blocks\":[\"

          You look great today!

          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1226,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":118,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json deleted file mode 100644 index 166b44ebd3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add paragraph and update selection_1_c3195620bef1082a4598d4a1033f35e2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning and translate selection to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Fmz6ue7V3xdvGoZAUYWZnc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TjjJnBPLTS4mPkomX98C9m\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hallo

          \"},{\"type\":\"add\",\"referenceId\":\"ref2$\",\"position\":\"before\",\"blocks\":[\"

          You look great today!

          \"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1044,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json new file mode 100644 index 0000000000..abec0aa7d0 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019XyfNqUjrnfQHHByqyqbLM\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1267,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph after the first one\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with the text 'You look great today!' an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d translate the first \\\"Hello, world!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" to Dutch (\\\"Hallo, wer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"eld!\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NiQeU5XsHrXmUZ8gMTj7m1\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"loc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

          H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo, wer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eld!

          \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"},{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"refer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"enceId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ositi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"aft\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"blocks\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":[\\\"You look g\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"reat to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1267,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":170} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_8b91d2f21694112af7f45ddd4338bde2.json b/packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json new file mode 100644 index 0000000000..4e170d431d --- /dev/null +++ b/packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015efjgzPcm5JaXpWsdS8UHa\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1077,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll help you ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph at the beginning an\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d translate the selected text \\\"Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\" to German.\\n\\nFirst\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\", let me add the new\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph with \\\"You look great today!\\\" at the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" beginning of the document, an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d then translate the selected text \\\"Hello\\\" to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" German (\\\"Hallo\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017Mj4wAAUpHKuLm5YU4uyUT\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ti\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"referen\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ceId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"position\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"befor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\":[\\\"You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\\\"]},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          Hallo\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1077,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":209} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json new file mode 100644 index 0000000000..c4347de726 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnp2hde3b94mpn9ttzpm0d\"}}\n\ndata: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"24zqyqf56\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnp2hde3b94mpn9ttzpm0d\",\"usage\":{\"queue_time\":0.123010247,\"prompt_tokens\":943,\"prompt_time\":0.108716759,\"completion_tokens\":64,\"completion_time\":0.171260519,\"total_tokens\":1007,\"total_time\":0.279977278}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json new file mode 100644 index 0000000000..fb4d7fd758 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnp31gfj79vgmme8vv720f\"}}\n\ndata: {\"id\":\"chatcmpl-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qakv3aph8\",\"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-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnp31gfj79vgmme8vv720f\",\"usage\":{\"queue_time\":0.10705839,\"prompt_tokens\":768,\"prompt_time\":0.065262303,\"completion_tokens\":61,\"completion_time\":0.147387313,\"total_tokens\":829,\"total_time\":0.212649616}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json deleted file mode 100644 index 36120cce75..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add and update paragraph_1_2bc8ca15e7b2f16c0fb12dd63f59db8f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29d44b988190bb2162488df224ae0cb9603cfa40e653\",\n \"object\": \"response\",\n \"created_at\": 1758144980,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d4f23c8190abb5d7648be2619b0cb9603cfa40e653\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 738,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 794\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json deleted file mode 100644 index e94c587dfe..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/add paragraph and update selection_1_2260e18485e60399528d870f6f325109.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29d60754819786aba99f18301f500d2e6dcd281ab8a9\",\n \"object\": \"response\",\n \"created_at\": 1758144982,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d7ede88197bef55cb27ad4ead70d2e6dcd281ab8a9\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 571,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 54,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 625\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json similarity index 51% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json index 7045c378ba..1480f30b8a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a2b5d52e84a94b234db1603ce5f800e4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"05Nh0RAQfjzl2I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"d7WTvh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"QzHzIB10liZb2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"s25Nl16Dm1sm7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"MKvLTuDAxk3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Gfj4vrZh1V0jW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"af6Tyub3iN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iH35CRtWBsn7o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"X0glbBSV9EcKhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3LrnKwMyna7iN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Trh3xz43e1F3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"bo2cwMcnAVe4vlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8vqvHZkICb3POdM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"kTAn9XbGvaUMz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Xy2voCXmfNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jchJzOyJiiUVY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ZQuQsU6H9BbnmOZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xUiHuqt67QkdjAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eUsOPwiwgIhGos5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"0a0OKu827Kb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"DghyZ2jpveo3J0S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"V8JthzkB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"LvARIzb6TfhaEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"4OLyNlpaikSA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"8px1eIobbrEo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fE8qRjJdaVrL5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"GIAyReE76twFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fcaesSu96hbtT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"UcsY3vT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"nyh0QWqU2UwV3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZFU8aY0lVXE6a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"CIkp4MKs28l5m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KiQ2DkWmztrfe0z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"U4e39tcq9IXMOmn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hwadJcMGMPdD8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"al5gKwJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zKUOh0hDg7j9U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"LeFv0OCG1xv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u8UftDYS6ZG05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ftwu9Bp6Je\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"mKEvBJ4aLhx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kVVRosyrItt1j6Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tDhpcPPuZSe6AI3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"QRGuNLgrz7Qv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"LKY2lNEz6TR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"TcrhpPr8sq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xrGf0q71MF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"YY7M9O6AfseavUP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"nk3KNGR2t8jsh0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"QopwVz74HhqON1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"anD7CwtAZwjed2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cb29a5d6588196830c93a6b25562c90c14ceaaa00614e1\",\"object\":\"response\",\"created_at\":1758144933,\"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_68cb29a65c208196af72b88899177d9e0c14ceaaa00614e1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":738,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":794},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Ev716GXYeyA2NS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"XuTQDv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"LBnFdP0rcyNm4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2iUfXaZhTOOPRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1sEu45CL0ls1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6P6AwgJF5bRUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"YJsQTCBRpT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DL6CkTBIF9lao\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"S2UpDPG3dYclYJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IIIw7PZoUQxa1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fN7K3uJHT4atd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"oWrHxJBdG7lEeZr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zeyRIANfcfvQWvs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dPYLQMORZX4op\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"GuNsjoZJma3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JpozaIpw0sYqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"I5bn2S9d6sXxNQp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"uvPc9IYdNsVGY9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nDUsVAgjnwX9VED\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"ieLpZ14f9pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"lfOz1pS9LZDRqLb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"9f3Lfh8QF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"PNfP9M0P96stDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"zWT7CXUby6P3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"XT9rZjsnz2zL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WtRmOEJGoqEm4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"5Yj5FCmpnKUgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wZOG5ikLOUzrr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"aPtxLaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"d0p2p3UlVtbfvq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nkDTJToEZSQRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TjZwxK8MjVgwz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"t0HWZDyXBz4DApS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"g3X8g2vEAXMdEXM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ISOjB2TIxG3xk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"NcAofyI5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PF30SqX5nrmIg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"NyriqWFOMlX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UQB5HRm676qKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"IHzoDTqV4s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"DXt7AiD2mlFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RgwXDKUvVyD2CwG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"GxawDrHuRVsYCrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"IvD7pnDmUldr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"lTfxAHtUMQy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"nxgTeAFgyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"aNTzqcXWfm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3z7O1FI9xbcdwBr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"5IfIfxul79CCGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"Cd2wE25ZdahxiXk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"xSkCws2bAODOQc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":746,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":802},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_c6fb82e817b9dad69fb7d7369cac5784.json b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json similarity index 62% rename from packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json rename to packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json index 8f02ad3aa2..3a085f6264 100644 --- a/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json +++ b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"riEVgB9ScbPjm1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DkxmAZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Eu5QL5xEueySw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"UrH05StptHtRRd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"v13tOreQmFlH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MfKxicA0DIKZq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"B5FcqZ2Ijc1tZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9uHi1cI5H2uhX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"pTLxC2A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"mLhPNRje3guEH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zjI0ggUOTyYjj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qpYF4k6cZ9Hlw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"elBBkDVXcQbvBcs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8fYWyoyHgq2gbCq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gQzPTBZWH22Hp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"Ehvee8BR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"n36O3DnidI5ad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"QKRaeKiEsU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"W82oHeyrZrzL6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"jgZvC86I3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"xTX9QJycRL7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"wopOR19jmBNl4UP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"X56J2jnoYLrR1ye\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ota68F8D40QG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"WkI7tsCDGxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"lqMOWvD02x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"ZFjvAk88Xc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"aVqFNLurHC8aw41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"QXoMUHi6U0xour\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"us0jh8cnydqt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UqDqcVwx5UhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BVR5MmYUoOG22\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"iNi8kdEfGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TuW4U37o3sa61\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mEYEm7kNOhsfGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mdYFHsKyHPk9p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"YQOe4vm9Xq4zC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"k8V37j95P38Kh3o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pSZUnlxOneCZ1Vk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oUaCt1elhcYov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"T6VJLld5bcb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mpZfK2GjBIS6s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hIzznXV6AUSPOTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dSk9R7q2SpXAc9E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nnfThzB9R43cVex\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"vj372ULjs7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"RvW2tsXX6i7weBu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"3cigmmGJ186xlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"eizrT0CoGu3KWK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68cb2a4f70f48195a4b9d5165de6a46e015484efd84ea9fb\",\"object\":\"response\",\"created_at\":1758145103,\"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_68cb2a501cbc81959666f322b0225696015484efd84ea9fb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"7jHYVCWvyIVp87\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"aLlOkP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"D0M359280WPar\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I1AAqmAERChnQ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TFVXCDyTiF5G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TeMw1katx8d39\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"sK2W8oxjz1oJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Q8mJiC8SCKx9M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"azEG1OX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"iY1hpVkDBYBMRg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LQLezVaZ82h4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"HpnJAjnaZ3WXg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"d7lFf0j97Hb0Ifc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"w2s9SUSHEZjxFyc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Euv2xcDactCQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"25u8EETg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Z11QCaAME2Fmb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"PMdmnxGWO5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Hs921X2U20Cux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"2fNusCnfgg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"H9KpR69PCfDr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VesFcjA14jjaRYt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NB2s8VmhwAUxYgl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"s8hw4HrQN6kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"G5B3uFliYzh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"KjIhqz7I9j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"NDnmPeE8TM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vhWZU1vDaIyfh48\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"Gvq4UgoEHA92pu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"oC8K25mOc8E8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BM45XCCyivRd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5ZLuF66uOYGaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"52P5ithYEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"MufPUBpzURdQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OxgmolfjPNrKnQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7lCOuUQjYVwyz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"27qvbkRcjdHET\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"yKbu1eG3Pn1Uizr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8x2IHAIfjYcZtsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gN1m2xZO62UOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zI3OsuPaX0n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wDk3X4668GAXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"FirWu11KzAnqXhE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3MFJeyZgEKT9Vpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SmtmAazHfag4g3k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Bn4PacP3PbP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"u70dCGSys3RoQZo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"PNUbYvvBhgUdUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jgTxN2NzJ7aiHQ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json new file mode 100644 index 0000000000..220608273b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"qV61P3QuGOukgAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"icjiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fbNdOXozLWn9s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JzohruDADD24oZV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"WTWSjwsvVNH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"VqK78F7FecnnC3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"Wk9zfHWxy5by\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"OrJVVcrUr8A4eE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"8qA2bj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"cDZaJcTFFRfvrV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"cqRxDgVGk4EGpw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"OM15dTFXjDuv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6eZLWiyMK3zHNGk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xPWikkznlmKZEfy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"FDVaOXlIGCPkTO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"jMv28g6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"A86K3Yg6myPoLx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"after\",\"obfuscation\":\"EzAbKuZpws\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"0NmFIK1lzdBlXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"dv3tmReLy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"xUi4Betdj6NXK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"4TSbmPKo6ygk4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"OlivjpxV8A1YpPu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"T4fOIZL3mRc3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"2D1fHU7aLfD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"E9QFAVTgHf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"qijOXPCpOL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"0SII29XhG4FCl8u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"pWXWlq8mz2WxIj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"UfyRFJ8XB7SnI9x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"CjRnZ8lcmaywdq\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"l7H5vkIXvSr8zEB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"gdX5N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"dmyxdPTelIi9O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"0FuI3PBjw2nYUSa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"sXdTC7cBPXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"ZrS1y9ykRg75wl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"LHZFmIdCS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"IizlEARSauQK6Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"bR1cAUCIAVhzk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"vHCH8GwiPTPfse\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"UnuKFRocYOpZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"1\",\"obfuscation\":\"f9vKqrNyXAvbOpl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"RUmTgnDtlkKMo1Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"Ix1vopuV9ZSuyg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"2odqPVtRxq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"HtDybKIxwR840Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"fPXoZP6OiEHNMZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"yesxJLVl33MTVru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"9GWT40A4NboITl7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"uFIbgBnkanB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"eKtamH4PnH3yEBC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\" wereld\",\"obfuscation\":\"8BS3p91Qz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"DMDhu7wYivYee25\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"vrgISG78iR4hw8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"muA100sgxDAaleE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"etOVt2My2QxgKnB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":67,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":68,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"}]}\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":69,\"response\":{\"id\":\"resp_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"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_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, wereld!

          \\\"}]}\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":770},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_796d3b3fb3726692a8631a770864f39e.json b/packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json new file mode 100644 index 0000000000..b28b446c72 --- /dev/null +++ b/packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"dBAYB7f3FxCmyJR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"zn80S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hJ06oiCzrTgET\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"aMr9OK86LQbbl0g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"8DVYvNKe6xR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"wBVhuJxsTh2qFu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"WDLElzpWL2vq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"euwe13w1gQ2eFZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"4lPSOE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"NVhsGtOWY0h0P6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"9XKF8K0iM62W2i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"ZwRFpiIvBsa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"L7vxjKYqe64wasd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"zoYIlGc7dPsOK3j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"iDckMCZtLbJaIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"PMVwunI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"q4x2U9tmfM9ENO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"before\",\"obfuscation\":\"KFLiAFSqL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"SsusZllnmEgVF9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"LX00AfU7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ewyRhc6B4poH4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"SR5KERtdGkCdjp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iuKEZKO60xOUw2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"zig7TePmeqEm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Ho12xzI8wSs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"9qJMOZXMh1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"ULifAWd7ov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"whdxYJayUYQr3Vf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"bmD3sXIizilgat\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"FctAVdNQeIuF4Lx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WDFFzqzqcAmMjB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"KgIwmYBRlpMGJBY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"aPf8G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"ko3C62vcl9Bev\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"AOaGCdOJHMgtJe5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"ClAmhk8yGcj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"fOGCfbp4v6mXWb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"icc85wIBW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"WSSDk9G2c4xT1d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"qqy7Ah1dI8DWR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"FkvX0ZOmQYM1zS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"K2IK0nwx4RK0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"CTd4oyJaRRN7Lge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"MQX083cHCIYxYDJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"I0vLtxrI1cN0eh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"EbNWfkK1O2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"QDd34cUX5W3yhm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"xIgmiilkGgz3wT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"w6H2S6CaGEI3Xdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"YdvdBchXgr5ewmF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"napkVIVeoVk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"WjwyexpyJNw2OIF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"JKDlzu1BS0PXwr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"CK6KhsFtTho1Wxm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"pItEc5UqUdc7kAo\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":65,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":66,\"output_index\":1,\"item\":{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":67,\"response\":{\"id\":\"resp_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"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_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

          You look great today!

          \\\"]}]}\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":498,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":96,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":594},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json deleted file mode 100644 index f2567c43c0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/delete first block_1_05fca597808a6f25433ca045a5ef0559.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01WncjAqjV2CzQ9TcrjD1cYU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_013fZYkd7j9T9nmn1ykZdjrj\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"delete\",\"id\":\"ref1$\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1201,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json new file mode 100644 index 0000000000..ceeb55dc52 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015vjxuH1ovSf4FowyokbnZY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll delete the first\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph for you.\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017Vzvr76KQukhQSxtsAHHWq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"dele\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":92} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json new file mode 100644 index 0000000000..7a68b83644 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnnzrpe39bhd9x91g6cwg2\"}}\n\ndata: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"fsq7rhvc2\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnnzrpe39bhd9x91g6cwg2\",\"usage\":{\"queue_time\":0.12745234,\"prompt_tokens\":919,\"prompt_time\":0.259425421,\"completion_tokens\":23,\"completion_time\":0.062716465,\"total_tokens\":942,\"total_time\":0.322141886}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json deleted file mode 100644 index 0b8d0fd1ed..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/delete first block_1_7d6b50b0908779f526df2beeed42aa33.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29d3302081958deb34668efb59b9051fef0706c6e057\",\n \"object\": \"response\",\n \"created_at\": 1758144979,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29d3b62481958195bd2246f38814051fef0706c6e057\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 714,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 16,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 730\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json index fd8154da1f..25a44214c5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_7d7fb0886f56d21ab74ae5ff29dba403.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0S7RNyMGPpYMEd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oVsr6o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wH5qsegPG8Tf8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zh3S7jYWiAsEwU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"bVtV2cgEHtFf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N0dAdn6WVZrY9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"FKZPzEIiNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4llKpeAIluL6q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"fBpO4DsNqIHlaL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JgrPKwF1f6TLj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"W5KDkk1gRBGKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xYmiy7WmAcnhRlF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JBq2k5F4U6fo2e4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ZBzk15Q3KhrWMe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RDM7ExiWJ36KpG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68cb29a4a5208196a41e3979e3a0acbb024710e0a07b2630\",\"object\":\"response\",\"created_at\":1758144932,\"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_68cb29a550408196ad75ba1577f87f8b024710e0a07b2630\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":714,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":730},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YXTMAX4qCOuMdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"M9kanK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CukqE4OapU68f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZDK97XuPh4kdCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ekjQZogVdvvn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8lIM8NdGJE30w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"trCmDu8zP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"c0a4DrsZK3Oxh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"q5PywcAJJPGv6j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"piHdzCmfQWWLq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"RR1tFlFZLiHAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"OC1aLq24sFknQx3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"cafIVucmiYkyJtf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"kTizBpmaKgiV8X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WapZW3RliwerYF\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":738},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json new file mode 100644 index 0000000000..186b7684a4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IyFbHFGl4j35Sr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"lCxWaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"NosJhyiRJtzVX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"x8V6xyEyqScLXA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"c0dCPPMfwoIA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EenRo958mOh39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"delete\",\"obfuscation\":\"0HBXyGxI3R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2OIJXSOLtCTOf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"dRsLEQpjf095zX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"t89o4kDRUIW3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"K0T0qGg7lNOUQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"xldVDEk5XbK15iA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"lJiFkopSwBgBJzg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"0EEdfn7KSaozJX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"MB9SRVo5gCRHtw\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":18,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":20,\"response\":{\"id\":\"resp_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"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_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":649,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":675},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json deleted file mode 100644 index 6307ece647..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link and change text within mark_1_cb7bb5a13c260e01317448090595ee0e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01AUo2asF6DLwif8KGGHTufr\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_012zHgfF3zze1iFzYk5N6VAk\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

          Hi, world! Bold the text. Link.

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1221,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":70,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json deleted file mode 100644 index e5c12aee4f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/drop mark and link_1_8b0fe73e448aa675279e4dba4a804d78.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01W4oY41GE7dNrHUd2kKCDQH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_017rMKFgheDRpnquAourPeVw\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"

          Hello, world! Bold text. Link.

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1214,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json deleted file mode 100644 index eef3866538..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify nested content_1_488a0d087a0b1e01688f51ae05a3914b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01YZwohKoQtfeRMPLRMg3gAm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_014FVEYuvKEwJcJwcn69tgaM\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          APPLES

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1057,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":64,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json deleted file mode 100644 index 2c1f79bd40..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/modify parent content_1_c0db573b1364fb7c190c2ff2790eb1d2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01GDpNPwf5Q6KqMuVeo6favd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01DbiSqDkXfYaQ4Hg9QKAHb5\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          I NEED TO BUY:

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1058,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json deleted file mode 100644 index 053da5db76..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/plain source block, add mention_1_79671ea4a1807abe2acdbdbdc8d1a592.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QgcZZf3NKwvJNB1DSVT3UN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ANnbxxfAz648YZQRSTJcag\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hello, @Jane Doe!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1213,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":91,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json deleted file mode 100644 index 28f329e4c6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/standard update_1_d11897eebf4af50b80d9b0af2a1cc076.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Jdy9CwxcDo7kfxUUnqfhK8\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01J6p8rBvwChN7JHDdeCcQ9E\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hallo, Welt!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1203,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json deleted file mode 100644 index b00264bf80..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mark_1_4b283890bf3b97be66a19afe638bf182.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01BgsbZCs7s5kFpR51tjfx51\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UqJP3NUYyb3ZRUdaLmaV83\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hello, @John Doe! How are you doing? This text is blue!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1205,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":142,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json deleted file mode 100644 index 027daebf71..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, remove mention_1_228afd96384806beba53490617ca02ad.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01RHJ4Nhd3tDRZSTxBcGbCNS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01F1g2Eikj4R2yNvcBdxbcgg\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hello! How are you doing? This text is blue!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1222,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":119,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json deleted file mode 100644 index a3a5b69cc4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, replace content_1_d250c0dfa1fc195c3dcd0e1339c06849.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_018r85SsRrDzypsA4ujv7nWN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01T1jxyGXC85Djzg5J5u9TNG\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hello, updated content

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1212,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":65,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json deleted file mode 100644 index d4ab0e28dd..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update mention prop_1_cbe80ccdc904ff27cb59da774ed8d2b3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01YVEVQtXvfSew6UJpd3vyt9\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Jf3DrBgo8triWsW1V3VSMe\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1204,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":148,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json deleted file mode 100644 index 9146079067..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in source block, update text_1_00262aa7e2e7a3dbe561b186222af294.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01Krvym4gDLgNLdYQUapyi73\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_016kvgbrqMbB9bfqwjdznSrL\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1214,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":154,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json deleted file mode 100644 index 2857a033f5..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (paragraph)_1_8574c26a2e0ef804975798372b6f76c4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01PjTDBrUWPuHpTDJNeuQHD1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0119N72fADZAt8Uvmx6YsSRo\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hello, world!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1201,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json deleted file mode 100644 index 18e4464070..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/styles + ic in target block, add mark (word)_1_f4a2bc31383bc00faef808d2933ace4d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_012rCrjcxddvE9AE1Wjc5mG1\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01UM13nr1SJu8s5FJDdexVbW\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hello, world!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1209,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":69,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json deleted file mode 100644 index 4f1fc01674..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/translate selection_1_f71f92a2a9a3611028a28c1c24dde70d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_012NT1yAWkUcoopyRgAqrTje\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_015jhqZa84VjgNB2WchynAoG\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"

          Hallo

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1026,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":66,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json deleted file mode 100644 index 17443a1648..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/turn paragraphs into list_1_66a84f6298bb99ee6a647822879b2039.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"block\\\":\\\"

          Bananas

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01B6xgX4Fg5qQbk9f7XExanD\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01Pwjqa9hyv7aNeCUGuVhpu6\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref2$\",\"block\":\"
          • Apples
          \"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
          • Bananas
          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":927,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":112,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json deleted file mode 100644 index 72aaacec17..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type and content_1_1b323a77f9c477ec6dc7e0538d496bee.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_01QVne34B7Zdx4bmJUxGdBM7\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01ME4gYYuAELfZtUk87vbqiv\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          What's up, world!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1216,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json deleted file mode 100644 index 679119c0f7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_4ab38e1cedf41335ad0b75647aa29f9a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"json\",\"disable_parallel_tool_use\":true}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\"id\":\"msg_016dq6hsmDsEPUqfgxq9PU1U\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01TsByXY1QwhkmbxwegXjKa8\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"

          Hello, world!

          \"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1203,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":54,\"service_tier\":\"standard\"}}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json new file mode 100644 index 0000000000..613c89f3fa --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_012kwcCVuvThgqQTxbhXKip6\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1262,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll help you change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last paragraph to plain\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" text without any formatting. Let me\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" do that for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01ThEYbSzWp2Wc1VazTJBBDF\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hi, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! Bo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld the t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t. Lin\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k.

          \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1262,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":125} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json new file mode 100644 index 0000000000..a35af00333 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"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\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01GpNBK6yJkH41xJHw1iBeYU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll remove\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" all formatting (styles, links, bol\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d text) from the last paragraph an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d turn it into plain text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01AKac4D2b8m9zA545VSfmNR\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f3$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d! Bol\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d text. \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Link.<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":126} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json new file mode 100644 index 0000000000..f88522a8ba --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Ne6k1xysv6NAu6j12VzU1b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1098,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"Apples\\\" uppercase for\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HCokAvrBQtL99L79FFMvvB\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"block\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"APPLES

          \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1098,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":109} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json new file mode 100644 index 0000000000..f55953b726 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K8sRKBVbpLzHAPaLexVizb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph (which contains \\\"I need to buy:\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\") uppercase for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HqqL1GbBinL59vhXXDcKz4\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>I NEED\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" TO BUY:

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":121} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json new file mode 100644 index 0000000000..433a9d1afa --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01PxF2P5jBgyJd2S3RPB7TvE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph to include a mention for\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" Jane Doe. Let me \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"do that for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Qo8m2oFT4Zeigcnqu1fgas\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, @\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Jane Doe<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span>!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":146} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json new file mode 100644 index 0000000000..8804514328 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01G1oE18ZyNTd4zAzknos2ee\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the first\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph \\\"Hello, world!\\\" to German\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01UjMJtdv1o7DMzW1xtJgsai\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"b\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

          Ha\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, Welt!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":115} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json new file mode 100644 index 0000000000..aa35d86d8a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Nd7XpkvN158npkVMREZSsd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll remove\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the bold styling from the second block.\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" Based on your document, the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" second block has the ID \\\"ref2\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"$\\\" and contains the text \\\"How\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you doing?\\\" in\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" bold.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HPUtc7hsQeq4btgqcNZ4Uh\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

          He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@John Doe! How are \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"you doi\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ng? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"his text \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"is blue!

          \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":215} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json new file mode 100644 index 0000000000..682c0dce9c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015qNp7sYXipKvoyyUorb1Br\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the text in the second paragraph to remove the mention of\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"@John Doe\\\" but keep the bold formatting\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" on \\\"How are you doing?\\\" and keep\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the blue text as well.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01AhJEqfMDkm5p7jqtqweXtA\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello! How \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"are\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" you doing?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rong> This \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt is blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/s\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pan><\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":191} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json new file mode 100644 index 0000000000..6a7b8e645f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Wx7TtSKN6fUSHFhUopmTKp\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update the content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" of the second block for you. Base\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d on the document structure, the second block has the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" ID \\\"ref2$\\\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QihApvzEvDPNaskPorfHNq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yp\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

          Hell\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ntent\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json new file mode 100644 index 0000000000..d8ab2b7096 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CkZ6pKrRGqLsKvgh875fL6\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the mention from \\\"John Doe\\\"\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" to \\\"Jane Doe\\\" in the document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" This mention appears in the secon\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d paragraph.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LDnj5oAhpBz8eyWXsMzTv3\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, @Jane\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Doe!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" How \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"are you do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ing?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/strong> \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext is blu\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":210} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json new file mode 100644 index 0000000000..9a09784076 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Mfhk9c7oyJxFZ3yebjUZBy\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the secon\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d block (which includes the greeting to\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" John Doe) to German,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" using \\\"dir\\\" instead of \\\"Ihnen\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\" for informal address.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TjjAGXhq76XuL9g5LjtbRA\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"all\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ohn Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Wie geht e\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s di\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r? Dieser T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t blau\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":221} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json new file mode 100644 index 0000000000..3fb19d1438 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_011ZPjyh1jE921g5HJdxUERM\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph bold for you.\"}}\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nLooking at the document, the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" first paragraph is \\\"Hello, world!\\\" with\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the ID \\\"ref1$\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll update this paragraph to make it\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" bold.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NuHSh3BVqjcDR7aJPbi7um\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":144} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json new file mode 100644 index 0000000000..214419f7d3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_017dVr3Bt5eR2SQf4FHVTcig\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1250,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"world!\\\" bold in the first paragraph\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\". To do this, I need to update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first block by adding the `\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"` tags around the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"world!\\\" text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LQWTFtdqqx8aPjRr95v9Eb\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, worl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1250,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":141} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json new file mode 100644 index 0000000000..c60f13b84f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0137YefMeYJCYkMvD7hZg9Yf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1059,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the selecte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d text from English to German.\\n\\nThe selected text\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" is \\\"Hello\\\" and I'll translate it to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" German which would be \\\"Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PYVoakzwRnLZs1y4XEbHMz\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

          Hal\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1059,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":131} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json new file mode 100644 index 0000000000..5b2a2a6029 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `

          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"block\\\":\\\"

          Bananas

          \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_011aZ6J5w9AUwsbaT5qwcyqd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":960,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll turn\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the selected items into a list by updating\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the existing blocks. This means converting\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"Apples\\\" and \\\"Bananas\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" from separate paragraphs into list items.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LFomkzMGaZDvEbgxy7kwtW\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"
            Apples<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"
        • Ba\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nanas
        • \\\"}]}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":960,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":181} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json new file mode 100644 index 0000000000..0c52c0bf0e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Lo4PTTvypcPL9wrK4MAwhL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1257,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph to make it a heading with\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the new content \\\"What's up, world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\". \\n\\nThe first paragraph is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the block with id \\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" and currently contains \\\"Hello, world!\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll update it to be\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" an h1 heading with your\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" requested text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Je7Zh1ridtHQFRXrK98z6J\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\",\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

          What\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"'s up,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1257,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":164} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json new file mode 100644 index 0000000000..06700e46e2 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01FkC6xLfyFJTmyCmKh5tKPg\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph (\\\"Hello, world!\\\")\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" into a heading for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PEBz6ojHyXg3L99xMJRnJk\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

          Hello,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":117} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json new file mode 100644 index 0000000000..d9ec28ace5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmscye1mr3wx121ad6697\"}}\n\ndata: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"dzjf29p3x\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmscye1mr3wx121ad6697\",\"usage\":{\"queue_time\":0.168786054,\"prompt_tokens\":938,\"prompt_time\":0.077529707,\"completion_tokens\":41,\"completion_time\":0.091263618,\"total_tokens\":979,\"total_time\":0.168793325}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json new file mode 100644 index 0000000000..af13d21dbf --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmrz7fgcafa0ndq7n08yn\"}}\n\ndata: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"g5v02xv5z\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmrz7fgcafa0ndq7n08yn\",\"usage\":{\"queue_time\":0.198251366,\"prompt_tokens\":932,\"prompt_time\":0.078968295,\"completion_tokens\":43,\"completion_time\":0.104265947,\"total_tokens\":975,\"total_time\":0.183234242}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json new file mode 100644 index 0000000000..5f5dd661eb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmt6ce1ntvk1dw8b1thjg\"}}\n\ndata: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"htvchn6x3\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmt6ce1ntvk1dw8b1thjg\",\"usage\":{\"queue_time\":0.143378001,\"prompt_tokens\":797,\"prompt_time\":0.066661147,\"completion_tokens\":34,\"completion_time\":0.086528633,\"total_tokens\":831,\"total_time\":0.15318978}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json new file mode 100644 index 0000000000..3e6d2b0ca4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmy3ne1v8qw11g5qvwk2f\"}}\n\ndata: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"zhk4nz4da\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmy3ne1v8qw11g5qvwk2f\",\"usage\":{\"queue_time\":0.142714219,\"prompt_tokens\":799,\"prompt_time\":0.066927551,\"completion_tokens\":35,\"completion_time\":0.086290588,\"total_tokens\":834,\"total_time\":0.153218139}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json new file mode 100644 index 0000000000..b8c5603eb8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmx54e1st66f6pckptc3g\"}}\n\ndata: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pmep4xgsa\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmx54e1st66f6pckptc3g\",\"usage\":{\"queue_time\":0.14481466,\"prompt_tokens\":930,\"prompt_time\":0.07725131,\"completion_tokens\":54,\"completion_time\":0.113219367,\"total_tokens\":984,\"total_time\":0.190470677}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json new file mode 100644 index 0000000000..e2d48f5b59 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmgnkfg0bez1y5p8e1vyf\"}}\n\ndata: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jppp67h93\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmgnkfg0bez1y5p8e1vyf\",\"usage\":{\"queue_time\":0.122434484,\"prompt_tokens\":921,\"prompt_time\":0.086833867,\"completion_tokens\":39,\"completion_time\":0.105941953,\"total_tokens\":960,\"total_time\":0.19277582}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json new file mode 100644 index 0000000000..9b825acd46 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1ynefesa5zfg3dxx5p73\"}}\n\ndata: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"bp2d0sq5k\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1ynefesa5zfg3dxx5p73\",\"usage\":{\"queue_time\":0.722134987,\"prompt_tokens\":923,\"prompt_time\":0.084956387,\"completion_tokens\":100,\"completion_time\":0.180736938,\"total_tokens\":1023,\"total_time\":0.265693325}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json new file mode 100644 index 0000000000..8c48765b22 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1zpkfesv0hyb0c6n9xz0\"}}\n\ndata: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8hhnt9fbe\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1zpkfesv0hyb0c6n9xz0\",\"usage\":{\"queue_time\":0.362030745,\"prompt_tokens\":939,\"prompt_time\":0.077815581,\"completion_tokens\":87,\"completion_time\":0.161374163,\"total_tokens\":1026,\"total_time\":0.239189744}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json new file mode 100644 index 0000000000..7b61b70f6f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp2skpffzs823b2g9d3ra0\"}}\n\ndata: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"4yw1j7en6\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp2skpffzs823b2g9d3ra0\",\"usage\":{\"queue_time\":0.177781305,\"prompt_tokens\":929,\"prompt_time\":0.170193947,\"completion_tokens\":35,\"completion_time\":0.075324179,\"total_tokens\":964,\"total_time\":0.245518126}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json new file mode 100644 index 0000000000..8e8690f17c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp2pvcentsj3gqpb9159a1\"}}\n\ndata: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"39j7hppbb\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp2pvcentsj3gqpb9159a1\",\"usage\":{\"queue_time\":0.101258772,\"prompt_tokens\":921,\"prompt_time\":0.094021619,\"completion_tokens\":105,\"completion_time\":0.176930706,\"total_tokens\":1026,\"total_time\":0.270952325}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json new file mode 100644 index 0000000000..b4875fe11d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1y68e3ab0qkrgf40tn2d\"}}\n\ndata: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8j03kk7rj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1y68e3ab0qkrgf40tn2d\",\"usage\":{\"queue_time\":0.095893479,\"prompt_tokens\":930,\"prompt_time\":0.075971487,\"completion_tokens\":108,\"completion_time\":0.233811516,\"total_tokens\":1038,\"total_time\":0.309783003}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json new file mode 100644 index 0000000000..91a4fc70ce --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmqh2e1f9ytj0ba1mcdvn\"}}\n\ndata: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"zq7yzk5kp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmqh2e1f9ytj0ba1mcdvn\",\"usage\":{\"queue_time\":0.198305943,\"prompt_tokens\":919,\"prompt_time\":0.077834103,\"completion_tokens\":38,\"completion_time\":0.102862555,\"total_tokens\":957,\"total_time\":0.180696658}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json new file mode 100644 index 0000000000..cfc8c0564f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmq2jfg7sh4gpw3ta65w3\"}}\n\ndata: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qs9ktxdc7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmq2jfg7sh4gpw3ta65w3\",\"usage\":{\"queue_time\":0.228763491,\"prompt_tokens\":926,\"prompt_time\":0.078450272,\"completion_tokens\":39,\"completion_time\":0.096219399,\"total_tokens\":965,\"total_time\":0.174669671}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json new file mode 100644 index 0000000000..0407fe073e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmh42e1c9k2x0c0hr749z\"}}\n\ndata: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"d16tqea99\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmh42e1c9k2x0c0hr749z\",\"usage\":{\"queue_time\":1.7217411070000002,\"prompt_tokens\":751,\"prompt_time\":0.064931841,\"completion_tokens\":37,\"completion_time\":0.090980096,\"total_tokens\":788,\"total_time\":0.155911937}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json new file mode 100644 index 0000000000..9a946da907 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmss6evvvm7mk1fsq4raq\"}}\n\ndata: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"w97cg643e\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmss6evvvm7mk1fsq4raq\",\"usage\":{\"queue_time\":0.168483433,\"prompt_tokens\":671,\"prompt_time\":0.054854807,\"completion_tokens\":63,\"completion_time\":0.136827403,\"total_tokens\":734,\"total_time\":0.19168221}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json new file mode 100644 index 0000000000..3a8faf736f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmkfke1e9er7bbmykrgq4\"}}\n\ndata: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z8xk2ygca\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmkfke1e9er7bbmykrgq4\",\"usage\":{\"queue_time\":0.874671625,\"prompt_tokens\":933,\"prompt_time\":0.100309995,\"completion_tokens\":39,\"completion_time\":0.096549883,\"total_tokens\":972,\"total_time\":0.196859878}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json new file mode 100644 index 0000000000..85ca94d276 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmk1efg2r9pt2gs09tv43\"}}\n\ndata: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cwcd2x28z\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmk1efg2r9pt2gs09tv43\",\"usage\":{\"queue_time\":0.197800641,\"prompt_tokens\":921,\"prompt_time\":0.07672189,\"completion_tokens\":36,\"completion_time\":0.1052973,\"total_tokens\":957,\"total_time\":0.18201919}}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json deleted file mode 100644 index 985093c7d6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_e09ba6929a837a4a11aa4d124a0e6f22.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29cab5e081939cec1ee9dd1d1eba0d9703ef6e223eb0\",\n \"object\": \"response\",\n \"created_at\": 1758144970,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29cb8ae88193bd3f9fb37cc215e30d9703ef6e223eb0\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 733,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 34,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 767\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json deleted file mode 100644 index 39973511b8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_7c85ccb2dc0a0d1b16d1a4c2077ff282.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb2a5b82288190b6cfc3b1717f0a0f0981e1bfd7a1a04d\",\n \"object\": \"response\",\n \"created_at\": 1758145115,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5c106c8190ad2f9122dfa6eddd0981e1bfd7a1a04d\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 727,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 759\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json deleted file mode 100644 index fc69669718..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_bfc978f4d5fa050140ca2c1bf5a99e37.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb2a5cdc548193a4a9efe4f3b945800c3e1a458a3bf5d1\",\n \"object\": \"response\",\n \"created_at\": 1758145116,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5d5cb88193abbfe00121dcf0560c3e1a458a3bf5d1\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 592,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 27,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 619\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json deleted file mode 100644 index 3122050c6e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_d6cfb2c09caf4dc303d87359bdf2e9a7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb2a5e24148196aef5cb3344bbc17f0e5c6795e82ea43a\",\n \"object\": \"response\",\n \"created_at\": 1758145118,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a5eb3948196bdc051d9388065af0e5c6795e82ea43a\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 594,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 622\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json deleted file mode 100644 index 9083f1ca97..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_7eefe9f91a0f30ff02b536d713a150da.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29c2b5bc8195bcd807e17fcf6e68071a9e8e68b8354e\",\n \"object\": \"response\",\n \"created_at\": 1758144962,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c341cc8195982515005f5123a4071a9e8e68b8354e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 725,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 47,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 772\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json deleted file mode 100644 index ba7659b46c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/standard update_1_6efde673f529b56639c3a083147525ed.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29b2b3108196bb0a60aa1ed667a40b067427e926029e\",\n \"object\": \"response\",\n \"created_at\": 1758144946,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b338a081969aa0869ecd91743f0b067427e926029e\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 744\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json deleted file mode 100644 index 1dbde87586..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4f669f245ffae48dbb6b753c6e4ea671.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29bcf38c81949a15a9265c71539f01d21bbc3bddf059\",\n \"object\": \"response\",\n \"created_at\": 1758144957,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bd97388194ac28283f42ad29aa01d21bbc3bddf059\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 718,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 93,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 811\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json deleted file mode 100644 index 4111b661ee..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_da32e9f5bdc9f37e656ea4f08d9ba361.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29bf042081949325160705f12ec605b0ea34b55f3261\",\n \"object\": \"response\",\n \"created_at\": 1758144959,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bf741c819487c2fcfe83042fc805b0ea34b55f3261\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 734,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 76,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 810\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json deleted file mode 100644 index 6afc5df0c2..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_0819b3d657557550110223569d969fba.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29b9ab388195a83f904294cedd5d07bc9a75725158b2\",\n \"object\": \"response\",\n \"created_at\": 1758144953,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29ba35dc8195ae91d3b02c6718bd07bc9a75725158b2\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 724,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 28,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 752\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json deleted file mode 100644 index ae25994efc..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_e4c1051180bfd61bc46515e8f902adab.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb2a6370708196b30294125deba9a30e0f83c0e96635b7\",\n \"object\": \"response\",\n \"created_at\": 1758145123,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a641c508196bc43cbc73b4767c80e0f83c0e96635b7\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 98,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 814\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json deleted file mode 100644 index 818fe9cd1f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_c8a95723767bd6bbda955b9c97bb9655.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29baebb08197bf120aa81fce172d087a202655f4921b\",\n \"object\": \"response\",\n \"created_at\": 1758144954,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29bb97d88197b3d36427fb8a1c28087a202655f4921b\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 725,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 99,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 824\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json deleted file mode 100644 index 50cba62020..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_87799e0afe80a948ff1c538b8de016a8.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29c1ac6481968d248eea1e2f7c5b06d0e29660bb2804\",\n \"object\": \"response\",\n \"created_at\": 1758144961,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c226d48196b0cd9708a443f94606d0e29660bb2804\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 714,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 745\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json deleted file mode 100644 index dd2ba2b5a8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_c536370803c8d5b8e925f1cbc94df24e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29c05db8819698cc4f48d8bd9a4302d2ed0675b768a7\",\n \"object\": \"response\",\n \"created_at\": 1758144960,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29c101548196bfa4343cda6427b402d2ed0675b768a7\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 721,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 32,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 753\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json deleted file mode 100644 index 243bf67981..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_98ad26809047752edacacdefcb28793e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29b403948195931d82adf77add5c0214698ad0945911\",\n \"object\": \"response\",\n \"created_at\": 1758144948,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b50d448195b249e418d25c1c5b0214698ad0945911\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 554,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 26,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 580\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json deleted file mode 100644 index dd272a68a9..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_b52b1a76b761a53c8fa407c280c1768f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29cca6288194a1c043a7607c97fb0d9ee3a2554867db\",\n \"object\": \"response\",\n \"created_at\": 1758144972,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29cd15fc81948387f8f24f10abd90d9ee3a2554867db\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 474,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 56,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 530\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json deleted file mode 100644 index 47f91394ad..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_d9b21d6453f43da1a720fbbeffd1a49a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb29b7c12c8195a315a4f857d201d60a2a2d78ef35e812\",\n \"object\": \"response\",\n \"created_at\": 1758144951,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb29b835c0819590204df98c2a62190a2a2d78ef35e812\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 727,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 31,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 758\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json deleted file mode 100644 index d1d28a3d46..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (non-streaming)/update block type_1_f198c01d3ae7a854d3ee6112e9912e6d.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "{\n \"id\": \"resp_68cb2a581fc88196932a38c8dab2d7420b16e74082f53628\",\n \"object\": \"response\",\n \"created_at\": 1758145112,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"id\": \"msg_68cb2a589d288196a8811acd2e12f29b0b16e74082f53628\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"description\": null,\n \"name\": \"response\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"operations\": {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Update a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"update\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to update\"\n },\n \"block\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single HTML element)\"\n }\n },\n \"required\": [\n \"type\",\n \"id\",\n \"block\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Insert new blocks\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\"\n ]\n },\n \"referenceId\": {\n \"type\": \"string\",\n \"description\": \"MUST be an id of a block in the document\"\n },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\n \"before\",\n \"after\"\n ],\n \"description\": \"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"\n },\n \"blocks\": {\n \"items\": {\n \"type\": \"string\",\n \"description\": \"html of block (MUST be a single, VALID HTML element)\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"type\",\n \"referenceId\",\n \"position\",\n \"blocks\"\n ],\n \"additionalProperties\": false\n },\n {\n \"type\": \"object\",\n \"description\": \"Delete a block\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"delete\"\n ]\n },\n \"id\": {\n \"type\": \"string\",\n \"description\": \"id of block to delete\"\n }\n },\n \"required\": [\n \"type\",\n \"id\"\n ],\n \"additionalProperties\": false\n }\n ]\n }\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"operations\"\n ]\n },\n \"strict\": false\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 716,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 29,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 745\n },\n \"user\": null,\n \"metadata\": {}\n}", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json index aa5ff5481a..5f259dba86 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_5d10b789913219b679fdf022143d076d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"DwvIaRDfQOpKhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"4bPQct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZtfaY0u49QM7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5C4EL4RPndfN98\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mTivB3MKQVFI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ddfp0hWZeMDkn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AFIUBSherD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7HJGRMHtmqrUH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ThLhXQrTshlVYH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yNRhVat0GxCDG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bYs9dzdRShVBI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"co5zt4iZLoGC6Rr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"yZhjDlZdj9Yt6vE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"kWbtxnJmv8EGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"EmEn2Sss80l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JSDgvZY6TVeVj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uVyKOuZuutUHZSU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"zHS9nVl6ZjVTkUW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yvbFbVct3Cw1vxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"9vzaekWIUNsUtU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Ez0L6JoXPX3aljv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"a49BqiNZvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"X7ts9aWBIDvVfQd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"95rEYjLbeLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"O7K53tN5tufo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"9Yg0QoQKMhX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"CpGjYvtlwZ1wqfz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"r45dXnym3CI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"LQ7D41N4AYRXOTX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"p5lI9aBsLxygui\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"llGsnH4xL2Wckm\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cb299e3b9881938d9ffdd2eafbbca107988d85407e9591\",\"object\":\"response\",\"created_at\":1758144926,\"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_68cb299eda78819396196d94e7bbbc2e07988d85407e9591\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5br5WkIzKx07p2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zw6W89\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"mfcKrLx2AkMpF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"RgKh7kqmcNInJf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"zc3S9ek6MGWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KEqvW1CWZWjgc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ph49O1L0pn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"T9zPdr5XDMFIb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"M5hscfYUnUVVlX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OOfQPaGDYvEz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"F156IMkISVtrE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"JDj6z87msc8xMTp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"206Mju7lGB7Y9kp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GYOEnIveSAecW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ameUHo8oO2T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hR0mRlh4EYdOQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ExUsnLD4jL1fm50\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xHiidG4PJvP7Zxd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"RyJNC9w45TP4Pd2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"LyYOaYtJmge68a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"NB91byS6AZofkd7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"0ok3sbZCMk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"tSw0EfwGhvfaj5k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"zS0zQK1GvsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"CM4xikhCQOhB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"eXpY0FmRPFl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"sLVt8MS4LqVRbOX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"bTaBYQIjz3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"hvWUSCSwOFlIUjn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"u35afBz9u1uNxf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"iMopgsimZqotFs\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json index 115259da52..b9507b263f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_eacbe4b67ed506fb59e038041ae07f63.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nnKMw4KxnC5qWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AztjNl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"l0SrVyQoXMRW6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BeYm5X1q4rWxRJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"I6BZlRAEl7Sx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SejvsQm6k0KEV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RmbD7kglZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PROFY1XvZqIIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ha4eKhsEIk013I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6TG6U8YfooOL7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"X7q8hIrPjUt4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"YK8gmipCSjLpBoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"CXfEqDl631ojE7L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UOtjU1sjw2FjA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"cdohq2VmrcT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uPCHNCKc9zs1G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ISw6Es0Ksb9ltie\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yxM7QQNtxO40qKU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"Ys9ZOXVBje\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"63OYS133Z3pSmFz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ygKzjANnbj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"FvJLHGyRmHGR5BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"joN39TCLOhb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"wA3H1Ut8OSl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"1W1Uqq5zDxFDAjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"gVCB0C9bsRQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6SrbJOMblg87wRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"r2vjAJmfiWjqLc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"aoDLSY6PgydRuy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cb2a48b3f481968e009667840ee77a03d506df68deb61a\",\"object\":\"response\",\"created_at\":1758145096,\"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_68cb2a494dac8196b806b6ae230021ef03d506df68deb61a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":727,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nUmOrevqGS4QXd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TZyM5s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"eQ8qlytBhKc3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hQG21buVHNdJ8O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"k3b5kVkM4gIu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ytueO79lRqqd1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wBKOkHs5RB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Jrsg0BNU3PZLG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1C5IXclJKMk0en\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CxfOWm0zOGJm9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TRNciwuNQL3mU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"OdbWKlptuM7xVXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zCVG8VIbw0u7fOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2GYlq1DFn9UqK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"TiMngKlTJwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"P0j4Yx8Te9Mxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"t6MRpYaJqqlv5pm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"r3TnZ3TMrgqS3uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"fQDKJlji7z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9HtMgqq9Ot3dzOO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"pojUxMWvms\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"gcLKIB8IqOLfwVf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"JWo43FuIOwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"TDUf2uBO7Oa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6XzbsOrZ8R7em6A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"N6cxEZU2elR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"CosgvHEoOlWwLsx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"siALsHVrm7zjBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ZTbVYSjG5SRosR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json index f926fe449c..c84a6621c4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_66432f1424f3d197bb56fb91afdcb4cb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"wIqCS7o26IYSTI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"YLUlVe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"2AnhWLSCb9dpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HrJZiHf6eJZAVE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oG5PfrdXiTP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"uIQLWq82FlAPW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"rZXccuez17\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"14vAD2asYzVQz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UcTsD3ELU9pTC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VwXvguWPSREhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"awg6bib1muKcx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"G6PHFgDlxlOdJK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aOcbQx0UGVcpJQ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XVXfh1x0u77g4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"pbHtgvOMq1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Etis9kzeMjYYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"u1n06gwflCag28U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XA2pRCPlkAwoKFV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"ehUNQmmmj3XZOa2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"UXiitx4205aZG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"HyNTAd1epzPWm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"vn4iM3B7IqHYbDv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"izD9UdAbOXWITY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"qshwZSO81vLj7i\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cb29a18f2c8196b3c8fc61c018b6050606d2548b5951da\",\"object\":\"response\",\"created_at\":1758144929,\"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_68cb29a2396c819694ad0438a581753f0606d2548b5951da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":592,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":619},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tddu3EBaHb72gB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yv5BL0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"49U2gd32Merbx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8S4xGBNT6fHzzY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"lo08fKFMAzsH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SmSa9iiS1zvUC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"rkX2HG7adf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PnLFA11QKcUhM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"g0XUYpA62FNk7f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"muGmkHx42Wkzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"zHRM4pU23x83w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"OcZbQj0fHSzlOYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HQX7AVHCsAqVaYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5zY3DMrQPM1rg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"JMltvpYEgEY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w5qSxhy3e0cIo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"O9OfP68VRTVVE0V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"BXDhWqyt8C3JuKR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"DMPvry7zol5Dt8s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"OXSOedcD70cXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"gzHXptXMZeySo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"IsQ83VXdrxX9Frm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2zpxLr1sOtdeD8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jnFVfdWBsDhR1T\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json index f75b7a4132..4c4e2d4e2e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_119bf064d3d052e2c1894b98d02f4f7e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"l6yHTNqbWebKD5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"uLuyi3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ugP9e35Y1oMPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GLcZW67pYdJR43\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"F1O7aTe0kooA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3JXCieAnaETb3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IQQuJZqHCy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TPLlYYQrVR8QL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ebA1xEQnB76O9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Us1omvVRjSntR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Amj216AgOUBsz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1jrohGtebXNG0qE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"6BchjSac3AVzyTj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"onkC1eFyMTrZI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KczwHV4VFou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NBGG68F3uJSkh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1AGfeDHJEcVhOvm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"zfrkJJ3hJV2mhAz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"F8UF5ij6kJfGqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"KFWApg98rCp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"CnHRbEMsLnQ0Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"weDMywXIybH5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"vOq5zmWVywzLKUf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ybKSnW2mZzxhMO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"yKphGHnBeOSoet\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb29a3324881959a429deb542d7974086dface31fe137c\",\"object\":\"response\",\"created_at\":1758144931,\"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_68cb29a3be508195975691cf5dcb8f91086dface31fe137c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":594,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":622},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qVqFk0v9a4GAHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"wqkdcM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"To7p1nLks25U5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"it7MOsrX78EnMC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gHu0L04K662X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HDVck47T62U6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CFUTQeMGQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ri0iEfigNeN89\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"MAkty6aRfSiiGQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o20Cb1xq5dz34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3zYRb2IKOCB7M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Y5KMAfJhOcms69P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"oHyAnhsUHoRFszE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nB7qCqcatvRCe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ReztnpT53Ag\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vCGoF2ACRQGEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VKXZnPJJ7QTtFOS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rhhmX7DCo8HMzgc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"dM3wklORiBqYNd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"a9ECZJpuaR1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"amGWVIP50ZBfS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"SMCMp7RhMdVv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"hJZmES86Y9ZzOrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sFhJrYOCuJmIme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QVGiGQJNnIAtqu\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json index 223a31f6d8..5be87eb1b4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_1464bc74169f4b71758856010869e6bc.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tUBMB30pmq6Gvp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sGLTOo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"lSBgVUqbzgLz2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"p525VKHApFoRp6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"VdFD1Ra54ANS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5IaceQKHR8ING\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"q4pvbeVkHu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"tG3exnyBuMms1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"93EKBec8eT3tgp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DYzpbutGZZRWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwUJNR2r2wnce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"hITenuNKz5IDr2w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QOjQhVMkhm2ayIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cbwIQOiqi2MOv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"aGeNXLhi8X1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BuZn8j2o7KOet\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Ek0g5TGflNgSitS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"PqdfmP9NxhBJGRp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"xJX6lltIPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"wXa6tYQhMY9ZMIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZFW6T9wbbPrGFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"4MXFZfFD3sJI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"aVomJc0RcBh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"McWPLxlst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"yrXmLLHY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"oiIxYQF1105\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"SjvCP2acY3PQr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"N5alxJaUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"meKuKJiPoatLK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"hkalgg9WYlu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"DrQimyzzf9B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q3R80ruwVHBGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"cGSE4zZZGdIp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"KDNTRqkSdNoL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"smPr91rrgeFIn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"9f8Zx5o3p4Jf7no\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"MJ2ZY7vK9HJw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"276CCxdBSSyM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"D2r4nYPTbtNn9gQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"b5WviygRS24mBll\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"CFIOYgiEMg2hA7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"YsZTHiPGp6ZFWR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68cb2999aa1c81939949c0d0213cc26504df6b04a60c4ea7\",\"object\":\"response\",\"created_at\":1758144921,\"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_68cb299a252481938729ce1bcdfde2aa04df6b04a60c4ea7\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":772},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cPQpnFtm4oSCD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"dAm98h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"QMzGvNGIa4RLi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I5WpLFAfixXPyB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GNY4hDiJCrYV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"abLVpqkqPSpou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6TbNlXksXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Icz3KxmuxqbVT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"lkSvbSVBz6SQfD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yNksGwpdzl1g0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KwTWNJseUV16d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WfB0k3rWDvhphr9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HIgHxCa8GFIt3tk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Lvk3COevzj2dt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"aBlrFXH6zth\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OhHcd5dgf1WWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"8BDMlc05YFHjSn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"QmxIke1YuZxv37O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"to59TQZLy1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"J12S1yy3Mzyicc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"E6omujqjrUxuTJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"RemWfSxiq9QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Az4TWERl6TD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"l6qwH0WPy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"Uq4wTCoL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"4F0iXT5lHBf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"aoCNnWgcl8nrH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"nUOP9Exxz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mXhZqnvYjMTGNW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2Vn9lPeUTlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"957WOFQvRD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"MNXf8vCFnvtuQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"I7EZ9DYa4qlU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ftKU3h05J6Ns\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2O9vj4lTH2ogW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"9yijOBAC04IpQvE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"e3lI4P95lFUz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"xIQCR24VcDZm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"X5rTTKrdlwkhEM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"5ZcZWY2uYfbT1Im\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"moYHX3WDknvfNZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"tB4UgvfqsSQ5fy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json index 05f2e23612..9290061525 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_db7cad0db1ad4f96b7a12f28b5564d95.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TwL28ZXUErJxh4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"RVvvf9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"hoMlsj7n6qQ8m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"outSnuCR0VhKaH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"XJZu0SiYPLYU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PdlUoyue6rZKo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0YW6fJwKwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Z4Iqr6CLWrAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"cWpgSNQNdAJHzR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Dq9Jx2CcriHJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"55PrdjU6d1AT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"0zQLrzLw8plfEce\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5ErMCWu6iM5Wi4Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PelZKRhxPBW72\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"meG7jK6tGOW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QXRfwMGzk0wYQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"qTBMN1tIxalUaUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"z8UW7NKKO9nKOYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"bGe18qFVCnrYi07\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"tifwLHdcQE3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"levIVVQB4idpfIQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"yLL290ldegq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"acnWEDO4xxad3z6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"X3BTvrznUHtWKJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OuHBRXDvXHsgkU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2988b0d48196a0119c3c18ae23fb028610459efc7a83\",\"object\":\"response\",\"created_at\":1758144904,\"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_68cb2989614481968e8a74d1fe577f25028610459efc7a83\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":744},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Xf8hiCB01LgE44\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"n50bZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0FaHO2IfUcbpS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"zbpkbdBFMfIikQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"KcIvXTzqc0b2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yxhfmmSjk0Mzn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bsEPpQRKiL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"So5mv4vVkrfAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1tfFp48pFVYuEV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OTmjLZACqOKAg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"jF3lM7XKZko2B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"8DbhE4PaudwJgNP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Jhl0IxhAKpkP38i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4Spndo3YphIKa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QK5VwiDTE5e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B01PGHqViqu9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"4Ps7H5oEMWrwSqj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"8wnmOfWm7XYc83f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gAfsD18zrw4GRjM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"zdunylHFA27\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"59syhlJO057eyoN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"M51tIYXg2PS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KiVCGJhREWJCEcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9DJeXfe39udcac\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"SMrhbnIaCqrDPJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json new file mode 100644 index 0000000000..9acf101931 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VtGYtKusL1M5lv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"6cGOp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"naW2l2uCL6Jht\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4zZM87kzOOrH05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"u9ypwwP2qIeL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N2L28zI01GroM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"8yrOoVyGKC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GOsu5ZuErg8gm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"KcERKSSoVtkwRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qCHAI3LxIK8CX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"brJFRcCqZ7ViH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"DE1N5xYSfJJVbM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lNlaeyiuxmIRllM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1aztDuzpIE9Te\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SzThOU4NNwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nnOOUym7Z5JuS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"zkiQ1erHuGunaOE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"IUubfFuJNMkFU3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zCwKwlqguB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"4vpbFeL7IZ6KH66\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"6Uymn4iEXaHyar\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"ENWGYPOaWrql\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ztj8HQag6vw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"Wv8YnGAeS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"vZKsLMaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"lsz2JvxWWWy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"J0ylMKxzAfniH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"ew9EuyT7b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mGiSaTXuoIBqQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UkKPcjMUabS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"D7jQ0YKidau\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"oLjfjSezWHe21\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"FfXMmPCZTHvW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"bxIic8FPkUZY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"m3IGOPB5I8pq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"q0xn7cLpXHbOHtj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"SjW8fgBnGZC5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Aj4vXhm1AmZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dzDRLNY5rjcPk2g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vPtCiby0UyuLXvs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"CNc6HuDfOT0s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"Nfsio3HLQzdl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"5l5fOBMGJVXh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"eSfRckqdgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"tmdRNZN48ivcGaO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"5MV8bFtQid0BmH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Eta5VqPVR1j3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"mpSmq24dit\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Tt7KgGxJRTMlP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"5V8V8Pavgnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"7tlK9yyWKJLKz9y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"fcMhpKPQXo3A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"oVPaIQNXDt0cfaQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"iMgxNC5DAjvyRz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"8MoU5dOcfILx7qW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"gdoU7pVYAXx4zf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"miRIpNkZaubGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jQDBRIyWWSV8fhN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"JPCPVJeIywuxdXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"jGLnLKkIgF5dX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"PIiFI4WpJVN7a1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TkwVaJ0sbIhldH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ojBCEg6H5R9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"LE67Y0FkSn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"lIgMOCQiCo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"RzzsrL3E9yCvX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"obIaiCXB2Qjt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"kEQweUAaDbY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"u22Tg66l57DY8N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"35TN1VFs88t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"oivxtWuFbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZDoy1TvTKaQxX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"oZOuBElUn0qQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"x83l70SpBPwFUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"7nYSyfr91SL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"MPc1zA9I97w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"Za6CeTvWV7kC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"WVPCXrt7qgHTS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"xgn1qrsL0vPbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"NYgRW2dTlQeN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"jiELK1tAje1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"hEcpWdn3IK76n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"KecZeyd45Su\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"LR92Ic989ZsgllL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sfL2FMtYkbVT2x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"FnVslwIQSlybTA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json new file mode 100644 index 0000000000..b0fd628158 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"z0h3rlTX7pwE5a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"kvdQrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"T5hWThivI5Z8U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QiFHdaEF0WEOvV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"O3pobqWurxbp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ktHvD88Idkc0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Q4Wz0oqdP0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7Ri1rJrfaj5t5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"XE8OMZZFtnV2no\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mKXOTWkT36l4H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bOshPjIMrN0ri\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"B9PCr5gYOZQK6yb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"em28q6CW5qh6I83\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jGjLqFnXnRiP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"a9Gzt49Ceq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3RGrNU2ZstnxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"yPJZb5f063QH2Ra\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rRWo45eqDZ1ukBd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"GYpQC28idE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0jh4irtd2dRznCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"tDtT0TWTThCYyL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"EniAOKAXTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eQ0FdJy728VJjNp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"fxlBAA1zeYCRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"fzMwov7AOvdX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"AZHSv7UpSE6w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"db8twOkxiE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"8oSykUPpP2DZ65v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MvudE5T6NuYuOc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"VFrh0pXmdnmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"O8gpWEsEkg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gSNVyhGPNQXt6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"WkAhPKXmHsX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"Y5KhSGGEdXJ5Lbi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"uO0h5fNhdp09\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"QUAvVf6cCRdCRof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"9LV9IOa8XB55iR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"X6QCJw2jjXKxPmK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"wX9HY9i2KA2jM6i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"b1T4CPDeyZnKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"8A1MpO4UnA2Av8f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"BUrVp8Za42RGGJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"IPONqPu3Wybzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"WVAPUGcpo85Geg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"o6Nr7OpGDX4g7b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"rKnXvahITVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"F8wSB3x0Li\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"XJqjuXNrKuz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"xas5z10coavDL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"CL7XZLfBPBg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"ckwWVYi6FGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"BeOsFytZ3vTejV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NHxZCctld40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"Px4CPSMdsQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2lZBkNjGvRZG9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"94yKcru27tKy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TzhUq7Lmbr6SGK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ip6pmK3iMnX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"5B09OHAvzc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"LQzsUbMUVpKd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"chkFUSyrI13LK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"u6X2jCIKGp9FD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"lBKUEUZRIzQ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"EOrRI6N43bM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"9W3GFAFuw1LbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"MXMBorgLde5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"7lkRv4eE43KeyeM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WYHG85KrKnVzwp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3d5tLRl1d3K51T\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json index be168db23b..5d4e4fbed3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_62e4ad823a1b8dc9eefa6f207b166b74.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CHyN2vtFMprhb5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pEmF2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"dCwo23onKlMeo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GNDxMixexc8jHq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"EP5TnCPmqrPS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UnVn0YR5cUaRc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"PZPCfjz4xF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"09ad6yu2BNYRG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"NdGR2U49AEE7JB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HWPHDtCAFGr2Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qWkAgjTwhgqPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"MmoXqWz0siorD0m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"KQ2LZrJdkbO7NJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qw6jKshJXgsHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"YpvjzfEmr2c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RfLW6STIrAXEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"vYrIp77yLNWzZe6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fxAtO08ROKX45rO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"cHO6wNDonu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KHZbfjNqJhqUXWG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"dRY6FvcA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"wsVHjg2p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dJ6NTJX6uhpGr3q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"UK5nc6D9RTeSGy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"v3MdH3ewhA17d5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cb2a0f17fc8190bf9dabaf1d9e4b2705af03430432659a\",\"object\":\"response\",\"created_at\":1758145039,\"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_68cb2a0f958881908441eac88ac1535805af03430432659a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"eC2xAIzKwuIdv0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Em9Pcy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"auskRZpCjFi69\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tkTp7LPSsb6UD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"59950msxk20y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4X2TXBKWHIQoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"L3aEgH6j2V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i9OBSncN261kT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bJR3mvEgxIuObB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EhoT445CW6yZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tEOJugdW19KLA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"aH39A9PC5SLwnU4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"LwGIYn3lhLiYjRA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Dn4KjVqdlMvA5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"njXH5RiMDlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iKcNX590S5jA7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"XPjIlti4qPb2sLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"cBOuy8os8wCXMpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"LkBN99cvj0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jQVKjATIR2Lbel1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"CWSPFQKL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"4oKWQQdb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"21qygiMcPLKOCkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WTKVVoDYYu2Dr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jGH8vchOEhuz6y\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json new file mode 100644 index 0000000000..c7517be6e3 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8WV5Mxt7GYQ97b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"b0gDT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"87q7uSkPkwjJW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2A6aI6qhMk6cAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"71DRLF91Xk6f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PlwfWXpCdgCRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Fg4e4U1OG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HoR1TGNLVNuEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Crb8ealHlwvul8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BusAQ2htf04tT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ttdguDa5Fvn8h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"lCUMbJZU8CcU4bo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"hc2pSvZnZpSOwME\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UGDccR95KIChY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"fupBn08wtP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2eImBifCljClu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"sD1F2v0qn7vDb6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"nHOeAcTMXn23RE0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"lTgztAMzjf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6Xh5v3Wg5cgsklM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"xZy2HCcm391wlJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"JVskChgMfFWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"qikn11PrdGJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"6vlFavL9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"6zadtYAz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"WrfE9FSIvOJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"EK6LFyC8RxBv6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"qqy3wNQGn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ehnTdfzcuI3Pmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"5MC2zhthEMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"97QxWBtAp3M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"aV8C6fUr9EQMQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"fSTZRZiv52Tx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"gXhVKjFnkmUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IpiVoEl4Et2Lq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"hGEm34W0ahRTxcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"xbXwaRaxfaQW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DfeClOGo9tQg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"8LP9OVF9vMZdw6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"HO72Plf7drytvwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"VjW2AK94ozp7JY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"ZL9NqEbbMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kSdRuvqvK7FTH19\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"u0Rn3Uo0GDXn0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"wgMKSDjyjvvH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"0tQoTDebpP2m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"JTIGuUAjyi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"bGWFbUr5Iw5KU3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"fDQb83NI0FzAQC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"OjIM3hRgPYbn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"r8sewDzqZh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lWYxrA2bfogsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"9x9lWuaIucZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"4ZPRBfq0VYqX4BU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"IICxRPzx6yAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"9dA0t9bQWkzKa4U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"TJsnuWN3ZApBYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9TspWiIVYCnFqeP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"29GhST7wFxjr9ew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"wt2s6v1SAQFnU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jdGrucRFhqX3Y8m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"9rb61HHEszYi53F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"ZcIIz3WnG4DpQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"4oV6QYT2YQL7Gd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"umiFXjedUZ7RWZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"gN17jDlQfEt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"hPIXVWdXL2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"JbYegKZtopa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fANL01I57nsPt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"l9ruK2f4kYwm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"DZhlrYInqeG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2Zh5mHv0u01ce8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Pp9MdwUW6nn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"PZ8nyDbOfI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mpU0KpcHH9NP3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"WtEiFFvJ8blh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"QMBgA7D6GvYPmN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"0h2mG8erQMS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"VTUJwuLvugQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"QoS3b0UlBZt5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NFDCGfXyD3e1I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"CEidbTBYTm0Oq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"z5jE3yAeDw3m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"Yei0oFhdZU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"9h1Lg8ezkHQAn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"1Xi0rizl5Za\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"QGbmAHUuNfKsqRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2N95C3dOXlbAjY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"YAtY0ov5M67ET5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json new file mode 100644 index 0000000000..98db0546b8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6Q9jEtIfrBRuJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"V3mksd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"xz4wGZiiC7SyH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"yNjz0xuLBi1fX6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TVqC8RhuUfoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7M1M62qzYubvU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"hP2Hh2xBTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aU1OQXwlJt60i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"vc5q7HIeJDEIwf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HFC5mofd7vSS9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kYtCvIrEkbioa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"LvHHgoH4gjNdNJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mOu9giqYCvzWOMq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8cn4OT3auUUrX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"wC4Tz1Abv3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"P72tdXVwowEs3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pFqIibarn4CZ17p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fO0OqsVOWUxfVJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"soRcU8QLUDJBVY8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"hi5bhIqJzMd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"VeXKU1pyQJYmbiJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Z99Gqh6udDZg07\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"AaXnWpUlNGxQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"BHuOyQWIBuJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"4dqLUcUwV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"YWi1XyR7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"iFHuvugeCyG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"jHf1v4GzdMHdX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"Rra75Q4mz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Q94e5hSPYN2E34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"glw8MoT0EMp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"NtE2SV8li5o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kJ0gDzSB5XOgO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"9BwotPDS8tu5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"RwQC74dsO9rA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"KqahXyk3oWbO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"6JMBhEgcjaZtg1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"1CgmWUxQRtcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"EQABxrtl3fLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GQnJoGWWcYUy1Jx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"97C2dhUcpwsav3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"bc6Ej4G6bWdJ26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"wnNHigIHWc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Jhoozzvqcvms5BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"cu6XVlMiJTUl7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"L8cRSkXRP0p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"4tekWqlSiMSzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"8T3Z5opKT2qK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"iliZYwkbNjafz3C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"RcDwFMJIKexBL0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"viHQjtWBh9iH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"iXlkvQGGJm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"IRmLEfWECwBZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"IS0iIFMEBYS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"lRNZW6SfGn3QcaU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"XqdRJRxRaura\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"rPQAIxlTXZuuK4H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"GmwN2wbU5l6tn8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ArBC5pWmqtIJSjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"NssLWP0CwAHr73S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"pJuFYC4Rc3hYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"MiJ5sjgD6w1F3TN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"VI01qU4lRYKTFJg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"QWXIHrXpcWD6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"ZC82dLu3rmORBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"e7kTaJJ9f9lgng\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xbLqzZIMSXw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"LRhp9zoBdy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"68re7cc8MZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VpSTKOTEe7H0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"OefD6wLY7WGe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"TKwXoBfiR8w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wFDx3JEraBh5ws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"nOUMt5IZmhR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"kSS2zPbJWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"pNPoh7pXj2yxX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"dxKKsQPgNFke\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"A1RxLbw7BLxUDO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"PomNmQhQTla\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"bTNTm4mT7VU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"UnCVZwOW9kUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"UdWdexLc2AqEA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"XXEhAAZjgd5DW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"3n3aV7Vk5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"ajEx7yjoJ9D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"fJmaIctp9JUb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"9dFXrWSJY7m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"gvRwPdYW2iyhHPw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"oV4D1r7UgIH6Dz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"k9iLLnWaoCN4td\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json index 529ee82f75..f1638d1393 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e0e8269f15fb096e2eeda797c350c1e5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dITV8KrkFzVlLx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"671NSH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"VxDd7I68KosjW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"soAPr6bWoHut3Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"iyHld7D0usJR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8sLwfpTLRpsKQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"LB8Hl9568l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0GJNlHGKvDope\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"AhKusu6t2mORZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4jo2Xc6JDEViZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"eBCKWAPj5fis9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sHP4IGMiqcXs2H5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RDaCg0Rj9nWD9r9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PwVRSquIZLxvf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QXVhnYU8yq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"R6e6JoyBJXiVP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hga9HhsiIWmEtfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3h7LUg85j0TlETR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"3yQa5iFcaCfwHA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"DENNsWWRad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"lF0eaC6tNu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"hVWFZ0QjNXMqC3g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"NTCFzyMMmA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"mtqkNm9MDI77Tgv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"m8n9uTigw6uz0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"rb4lvbiOp7rLA2\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cb299846188196900759d05b9cda42069cb1e2ce7f7a19\",\"object\":\"response\",\"created_at\":1758144920,\"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_68cb2998d2008196a59bb32eeadf967b069cb1e2ce7f7a19\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":714,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":745},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"11US9jd29EV609\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cTbawl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iWLlrdX1ScUD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BaEKv5lczU3eCd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0o0wF2sLz12H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Yua8CqHPZ7TCG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"S43RkuSgHV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9hxW0C4QkqFO6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"CZJNKgWxZEyeCT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NOz3q5jE0xERf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"N4XfE1kJgSMg8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ltfY4qgjymSdl7K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"sZIL5AmO5xnXkHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"EOLGDBo8tA6xL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"swOsEQzGstS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"lxaOv9izmvJhn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GCSwk2dgTFVRNaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"I21tQgJk4OMsXEM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"NDv9fDIkNz1i41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"1mkIoASK7T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"XUtNMIJWza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"E4KxtAu8G8eBL1U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"4XjXpSpUNm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"pvsctZ2Z9vRPJ1A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1OSBUSmEPqFL3p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4IA5ZrKaE6lF83\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json index d49fd118bd..782932ded3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_b97a16df8573048752520fd36bfc321c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0hzwsQEf6UbqG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"lJHE2K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RfM9TBRDngWR2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"mcGUw7ehqZf4Kp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"5BDFdGRRmZvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FAGk3OhbldIgQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6lq0PdFvfX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jeRWzotXlHBPH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1mpFCSyKrbeueZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tYIMtqZ898pOU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"1hsAcgVmd7zIU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"6VWhdOECAKxMdVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"w6p64RetELUMJUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jF3mXGcXVhGih\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"tZs4Mj7tU0g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zNqrk0VK15XhR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RhVd7qmmngaGdkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Hz6dfFTrDmceHaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"q9FdilGpew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"SBuT92QpQzPeoua\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"B8EU1EHEav9QKZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"vwWNrocYPs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"vjR1PiumYns4kAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"JCBQqsN70xl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GVqCSvEUFueuQB4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"P3Zu7TW08ehWYj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OxBlbNEBAfneVX\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cb299505e081979f1a08548b844cc90240b1a58bb0f58d\",\"object\":\"response\",\"created_at\":1758144917,\"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_68cb29964c98819799708ad561be5a5f0240b1a58bb0f58d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":721,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"s8QY9qSUAJkT4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9nu0lx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"7ICd1GmpHHg87\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SQ99U1qGoiXAfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"i1lzPoB4sJRH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5dIgjcJ1rv3Pq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"JqPgdoB7ly\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vP7du5T8rIkUx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ID4beoGh5iuFB3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"svppOboxdkY7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"rWsYZ3yFjiAph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"PWxViKQ1LJv1MMY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"LEaQhQMNsVGXvrI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wL8tBy88NM8Dc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"O1fQu4A43rY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cgRSr8qYrNxmG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Es64V8jzi4ezRcf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"z3cmlaiLvHSSX6q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"7GxbvDBmOr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"OENyvVfvYTJ4ItM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Ejkq0ZxsoJwKfs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"4PEbwxJewA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"AoUOhjEPMHZj0Ea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"Q59pCl9yyH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ShkZBcnL7BzPkES\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"E33u7fBxopkouf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"swXerTCK2lqr8R\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json index 511da2cb70..0c68a1c040 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LWkxU1RXRZdvdh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oloBma\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MiW6shJvLNnr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dGWQW9GwaSVxwu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1DGe0viVGtGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oxXoYJQwfkHMj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bYzXV4cy6D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"S4dyHnZ7TT9lZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"h9Bpd5eHvMmnpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MkgI6nAVPFATa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"QHPBJmhVSnvfl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"1JWCpeWzm48EWbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Ss35351tBrwOO5P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"K113NDFQIcYMd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"0hLhK3EbNXB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NPWHveJ10pDpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"l5zmgPuY3kIIodb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"yFbVKDf2EkNSws8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"UPGK0SfdPddKZ91\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"BQlYLld4Mwi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"KGO6Ds86ohlYb6v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ChoeYlNJjsn3Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"vP4XCfgAr6Hb6F\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cb2989f1f48193ae59c949ba7de67209082f2a176db6c4\",\"object\":\"response\",\"created_at\":1758144905,\"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_68cb298a7f048193add2265bf9236c2309082f2a176db6c4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MARcyNUXcHLLmU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"2jvDpg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PBbEoHCB4q1RT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OdsuFwJtD0ofxM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ssxAQDiuxXQA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IGTxKVTCRsJJz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"awc1JnOM0q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UrAch8nSuPBYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UB2InJEeCbvtcG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7CpMzdcoDCtnK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"14VCCr2CH9CD0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"y2CZQgWGJJI7cpg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OLQHeJmO9HUbCDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oZGyKLhMsDHhd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"dJ12pokpFbb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZFATTNPiAor4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CxPTM4LJH6lmGOn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"EIocq0ZhxVajIHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XYzix2zJk10q5AM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"13vY95EnO77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"IFwsxFThXELP02G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"adQ0v6OLdNeYmH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"iW0T4avCbYkt3u\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json index 774f39ca39..30e3285183 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"zQk004fMpoQ5aU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"kbvcCO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"KGgK3ML4ilADo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lGKwTklol6rEUL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"5dJ8GzlBou3X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"V7KLCi5ksW7yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"g3OLWz2v22\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"osTyyuQlmzVpC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"AHufot4alKo7Em\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EY1DDW7QoWOts\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"BSGitd4zVxzL3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"TXwYEiLsIpAuN8t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"42zX81eL1jVBvLt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4TlEaDslTyk8e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"c7WPLGIuxRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IJBioIS1qkO2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CDfUTMRuCJgYo1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"d9jda4Tsvungxt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"lDv6zJjhEGggNM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"LcoHNfJaVFygoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"h5nbOVYydfjalvi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"k7UwgQ0Jc1Kl1D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"agU5a0cBdTmk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"kmoUT13UQdNtBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"CjnVlLZgkAFD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"uhehx1V9i6Kq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4oe3A2kLK0q3Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9LQVsfYV4c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fMpwJnVXqi5ee\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ZL7834DBRPHsAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TFaxqkvf7W1h8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"gTfRhJ98xWLLv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"OOByhZYbNQABTz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fh8QOPKjfAjTuBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"IPHk1mwlM1OH6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zpkmlc4H3Om\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"72y6m5QQs06bH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"HxZ3QU51xFaX2G9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"y2VSDfOM8pNok7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"tBU8HqvOdd4Or1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"CyUCv5b37hZR6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"mEk9VFkO2Sy4gpd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"vlXVivhp1eD3j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"xN9jkUjlshZW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"jFsU0PyQfzU494n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2hWKBAFa1oyNik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3dZSv2xelxDqeh\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cb29a00ee08194b593af4cf084171001c14550fe1250b4\",\"object\":\"response\",\"created_at\":1758144928,\"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_68cb29a0a8a48194b083bc27bdab9e4601c14550fe1250b4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"DuYe47vn3NRiZs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"eqh5ZT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SdztBl1q8vGGX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3IuPuvDwGr3C9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gFTxMe3sqUso\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SlBF3cLrrr3Jx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BL96ZTgkj0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6PrraNo93kuvn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"DaJvrd2KVnYaSt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SqUGvwkrm4p8f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"dDLeM2PgDXCCr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"D2H3HzpFmlhMquO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JhMHGLvo5MgswXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"taeuZQ0mmo8ep\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SpquGbZjtpY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VTT6aVsHRAhvW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"r9eryBGFz5pSgXD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"wrzQgC8OoOdw1m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"3TpE7WNmNt8Rh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"7LLiSaFJIMjBBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"iR30UM0boQN8z0u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"dyEf5DzpyRsKPX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"iZXJM2TBUgeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"F4Lb2bzyNpMkJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"wSJuKRGcYalR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"D1lGe4WIPlsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dQvWJrjiaIlWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"58Vpzjuesp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XmCHPjryDMPdM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"msXiuQcCQKMQPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yQ7ayqmrsgBdE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qdxln9dwHuVNN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"pTwYDtSpcYlvoOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5BMNHZGVtMyroSN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7e1i4LOFPLR08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qW54aJBl3NP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"41IEi6tZ5UOAA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Y7GSz7F9MR5AANQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"o5He355YTaW6K4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"EUkAQRCupNzt4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"Jzt0tw5J7O1VPl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"qXm1s7LFX7FWsQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"nyYYpxEDbfWUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"0ZKV8Tb8E68I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"w3pGuZhy9lqwFHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"SZO9VqUy7imMvj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"f6hfcSr6djhYEG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json index 7e0712cfb7..c460729888 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_fffe4aa2c8b43de2fc5ebf2a66db1265.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3qmeyfllZhZZQe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"OWkwBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CucgAZ75RHKwQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zs2njuZ6swIkhm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jVenbwN3Lcqj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LAgtWuKQ8z9Yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AOdQBD7ibP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1KrEJlRlyjb0Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"EviqVGLFjkVmQC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x35dwY5RMatei\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"oR2LXQVhCXlXU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"1Ilb45l92DvrV09\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lgtYact6v7Dx7nq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qIcdgyTXUngIk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"sUic68ps31N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DA0N0HNu5a5ZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SVGeT7y4YbNobGS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"IyEeDDtu0a5J2xu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"fFN4CMv6oqnjRZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"epBYstOn5EWT4iX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"3ROYiad5Yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"BtbkBZqaOhlHZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"7N2lp7niA98fuP8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"hSDzdoQIQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"pmQuZBAJhS24yfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Hd70seAbUqOTIU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"R9SN7VoUhHA7cB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cb298c661081939ea44f7808033147067c6a5a5c5096a1\",\"object\":\"response\",\"created_at\":1758144908,\"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_68cb298cf61c8193ad5f1b607508c5b1067c6a5a5c5096a1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":727,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":758},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"t31MkQEp1FIbrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"F6Y2r8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FnJm8ny3zzcq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YwAyjfrQUxMPbB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"w7spSTVRNyFx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8l4fHFjZiGUGt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"I4wodxskNt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5ik0ws2qPKR0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"H8dPbawIeQvZ6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SKex6HiCOTPTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ucvM8sQkeLL9U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ldpqPHQg7tJ0ESF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Zsxva7H6H4wnwFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ub2AJKa1r18uf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"POuiCg3xgMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ORIWC9AtSORbs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"fOr0Wn9BV0Nak9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"aQLWhe3QbR6v5GI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"cCKMiGx5ssAHRR1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"aDgxhdqrlD7K5pp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"ictoVNnEDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"2RuMCfGwyhnBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"YYhmd6Uo75adhoY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"gTJFbxY8qi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"rbJKqQsJbNqTt2h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Ey5iUBxub1Gu5w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QzCKEqdB0DOPci\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json index 4d94a482b5..9d3120d6a6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_d07f1cc16fc9441210ee33277c409acd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HMHZTk41PnnjqL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"38WK40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"cijrM4GEPWNlY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"bgyhQ9xK3OLZKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mlO7TqEpMbS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"H34zwd30KDBFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5DVaS7BQ6W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pmOE8SanK1Zwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PUsE7MCOj2Hf37\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OLlXOK7ca3fP3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"IYesxnboofQvc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"X1JoTwtHqKvskFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ixor3O8xBRyBPSn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hobVGMvc1PmgD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"YFjdiaXCzzM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4T2Jt9ogO0nDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6ywpmqCfrfoFAVS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"kznVRGnRqLACvsz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"l3kWLXNGJRT9qUu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"uZaCuP8WjD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9xYMIaChVPKQjli\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"RTsT66DMVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"U3bWGymJJZrGsW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AuSkRjZBOlaobN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uk1ZBSLXALj7Yg\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cb298b28008194ade1ef8b8d48da810885781ea5fd8ccd\",\"object\":\"response\",\"created_at\":1758144907,\"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_68cb298bba1481949f5ed710c72cc83f0885781ea5fd8ccd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":745},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"aSxFqW7Bz9XfUL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"dNW0HO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iacjWCez3yJEY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rlQf6Ec6TUKPJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gFpL4trXy22j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"s9qvYZDOdGM05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"goxzkyAaeB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"zU86UeT3OY1at\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"083BXc2UlfVxS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YXBmgD2NikiYZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"0Uc2eVBnsSUOK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"6xLFoCxZuavqFBh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aT3Ed97cCYpI3UN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vauvjO8UKoPBF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"E6pjvDlLzBc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fMHDFsywZXVcg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"vfi4QvaYD9Ywr6u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"xZaLg6XC8tqCLxK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Ze2LeXslScBHhnu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"UwpCp5zJxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GSHOECJrmgXPdVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"p6GYe50mwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"dtndc2XFqwUy3YA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WMxB7yW8tZ9dTt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"vqPmTYozuYMnoA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json new file mode 100644 index 0000000000..dc61c76dc7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LKZ37ghHZ7Yyly\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"vy7mbl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"X4yzhSRWbe1nM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JKL5EeHDWD8BGE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"9JXqZcYTFdz3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jIoZCedRibu7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"REzQmahc56\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1L9oQzad5WHkQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"d4uskjR4Rktb32\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1AodJmayeiFje\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"63wsQzSDHEvKp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"rSv58tn92JJBzwv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"sB5rvsDitKfJGE8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6gGHMZIAn5dZS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zuheiAcTEcs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yzo6CxPaCospV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"RatDqRpNS8wBjHs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"a8kzBkd251W4okp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"lUjEgJ9Kgwzt04q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"hXZVfJWf50kDMA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"3ujbRE1wQWdB72p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"4e39bzTqSI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Nq8uFGHV7025M1T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"cJ16y326tQu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"MynvS5R32wks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"V7tX9EOohSR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"MiCZBACnVaUu95V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"SNRBYauwtHs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"stLU647Wu8swhik\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"UUv76AjY7hHPd0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"gi8TAjH74u4QPj\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"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_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hi, world! Bold the text. Link.

          \\\"}]}\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":668,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json new file mode 100644 index 0000000000..32431028b8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"u93Kz106p3poKe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4KSK5e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VgZdOOxlC4tSh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"jW6BtdK0gmXHw3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"A3vKWYOlCUl7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2Syub660YoHVk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"u5ejGcsghB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"lOSXGbkP0JwO5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"R9VYJJl7UFMVJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"uSb3slCyHo1lK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Qiph5tS0O6gUD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"zcR8yw4MjDQh4IH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"IMBlrrjP5mQAkhE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"BagVYZZt5kzGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"LWrbGxZhWAF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"FFdfSS1x325hM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"X1ZkKIujCpRuySQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"BudvrkSQRECEUhD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"jTtAqqSVGK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"xpaGbZnssoe29RX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"Ea3j3uV5To\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"UIaLkkF7b0kwCUY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"5EwvX3KDUqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"pijh7apFm8O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"K82WlVDM1UCSVkz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"LJab3PbVUru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"cRtJ5f5FNvoxPNB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"zwc21CUbaAUj7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Dj9YoHhQZ48qWg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"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_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]}\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":662,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":42,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json new file mode 100644 index 0000000000..3d3a6cefe1 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9KO88EwkHENVEi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"PBD6Or\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"aB2itw7zUCsac\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XURtAntThp97hj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"6wx7ybOIg5Xx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"8Xiip26OTBShe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"yJOgG3HkVA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Lh8BgfdMHpqpe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"5mNKaityNnxZdW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"YoGr22e3cxAaX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"q4F0g4sIXinuG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"6n6ys0KYuzuNAD3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"kVVg6UufTxDGwzV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dyMOd2hy04C1g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"8PsT3u7YV0i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ANIybj3dXALtS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"NxfgAJPcXIoujZB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"0aZBdLrt6x0mmG0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"DFxwbsbib2ZjnsJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"8xSCQf4zjzx3z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"lCuRYUGwiI6r1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"aFBimoTo3G1DNhH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"cAwlA4aEAoRHtT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IBdQyzsVwnZBJ1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"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_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          APPLES

          \\\"}]}\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":527,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":37,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json new file mode 100644 index 0000000000..5fbbebe82e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tRLMO2fIdtuJeC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RtXFC1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"xfLWFGq4oGKB0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"t1A6xLnm7k1Bgu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"q34FpzVPDTrn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dNZ0d2XMtYFgY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"lU9J6VAIhR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"l3Op0zlgRrgBW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"z4d29hAmlTBk7T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3lq4rRqZvygl4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"aXFa92GexU7Du\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"LXY2J9Mco8Ah9pQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xYEfgQhnvL1rynX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ic4ZZMlffS8XB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"JO3nydnfop6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hfW2gtT1NlX73\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"EJzFUjrzsituUKr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"fEVBueYkUpFugez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"wuwQJlwQuVhXzG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"avR1m4QCYNZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"fKkE3vYvVjQVG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"rLr542YG8Sp3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"fCEvrhIVj3drcyR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"27aliozdIZuA0B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"3trvbtpJjDwPTZ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"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_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          I NEED TO BUY:

          \\\"}]}\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":529,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json new file mode 100644 index 0000000000..8f128afe53 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DvJq4gJIDlMgLL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kzwuJv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"vKD2PJppfPdQk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"492ltykClOi3Ak\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"J49Nc54RHQvr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"aEkTlAcX80d1j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"OnL6O99CJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HrhCoLMLuvVm2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"PJRwaORTpaoU3T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"IlNT7LiQWDA8y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"73OV4veZppXcy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"86IfK4weiXubcFC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"2sJ0pAKDwUY8H6e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"clc1Qlu949sZ0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"iBsADT4RIRK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iS54fTHDh1mSu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"NZT2BnL9Gxe1l7P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"wocRt3Y18O262fV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"SZY9CnLjQq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"ejYP9IPaD2hIrmc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"6L4UtTReEry4ES\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"ji25IjMTpZQz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"S8OceMYHkGB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"8PBLiIDLj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"yQrBN4e1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"Uf194ixM4XP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"coJNVF01gd0UF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"qTKA8aPUo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"rE5SxHGSOBw3qT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"PTrCx2H1yRX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"eEkOyxMtx95\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"HQE89abNKUEyS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"hpfMzU3AaZs7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"0BdtLDtC8KMA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"J8T0KforxBCq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"GfZfJDlCh8MkULw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"xzyrX8Vm1Wxy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"sg73MTIGH3ql\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"tF9s4CnaEWmHtCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"GISitwbcs8iNbez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"zU4o3nVuTGjS6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bnkkP4Yd8daS3u\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"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_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe!

          \\\"}]}\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":660,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":57,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json new file mode 100644 index 0000000000..b2def1f0ea --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"EXFoh2w1GgGqaW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5FE6Y5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ONCn8b927mbgC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DddMKQJzbKXSE1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"bpp1bcW4KUUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3wB295Epxz8ci\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"5SkGxiKqa1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"qmQPPOlcxYHuo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"lO52py49Ri66cK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dcrTtEmPWSCSN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FVj0e1NxY7BEV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"YETC6IgfEYRBA8Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"VZILDeqBQuW7h82\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4XMg2hANGLmXa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"bDW77kouGNn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xsai9EeEJQgal\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YiCCGgpgiupG18n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"GrQiakyTIflwwMk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"txpRFRv32lGgLTg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"ITDxpuzURDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"wONOQKn2bfpB1ov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"sUv6DyxvKFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"KsBnyt1v4B5xO0r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"7UJmynUWwjIzie\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"m1vhgYM30s8jmg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"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_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hallo, Welt!

          \\\"}]}\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":651,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json new file mode 100644 index 0000000000..58cce080d9 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2H67WeDq3fQ0em\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"zKCD5X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"PqUu0rjD4JExM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Aok2gwlaBTqRz5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"KjcjD8XzrQpy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"igLGb5ClknNlu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"byx83YqaBi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DL6AZPDkxrwIm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"FAM8hsMZ35kylZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"OrTCZi1si7hLK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Njtc99TNd1Kd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ch5jPorPC3yJq2o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"QZFnpnQUk3rjrKV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GxiPQbXhNMv2G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ot0dvLlvCVv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"KhqFC87pMkdRn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YqwIzIbZ5oqMh4t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"IA96gEeEALY9aFp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"AqYIGZfD4P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"562FcDDGz27wKWC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"Fe2TG8fCWGccGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"Eo2sXSNhw6b5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"FDLPmVs8T1x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"aZVOP51QA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"aA3AdsGH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"BNOFzl58T64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6OwexSrd4cMhM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"v35vAuYpP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"EfQVm30kVJyQ3E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xzoPwRjbHBP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"m3MtB1CvJpn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ZOjQoHsi8Lz0h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"uvObDuTMYSo6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"jBRpIxJPz0ip\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"3vcZDtDxLr4D7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"IlPh3vJ1ozSfN1f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"uy4XkCZ3lyyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"gKqiaGPB7TzP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"j9E3IkNsCsy8Y61\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"HShLGWAGhNtd676\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"kUhZRO2vNzEY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"ymObqCnQaB53\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"LMuNlh1aIvdA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"RJwMsuXYLW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"Bd0LcouXySVec5r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"QU42LUCVcdvVqc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"76GvVHQL4G3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"FEOdpfWa7j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"OHYaiiq9RnTZr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"D0d5XUiiSIv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"Hgz7rqTamryQlUR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"FsPLPJra3DMC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"yBalzN4U3R6C9Jr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"AubnASfdjUykcw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"IQL0XpHgk8h9vlL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"yFbdFD5c6ukwUs9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"GWuMfbPs5Uxt3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Elc67PdQOoQF8n8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"X1qTP6ClpQxuQSv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"9uD6fM6wbshXV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"PK2cN0bsUGuaT1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"KcRJP1rXOiHOn5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KYg5vAW9jcy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"EIVC0QOT7i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"Yu5epaYaI2X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SOsSuhPFAwmH3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"dtxM8jKm6Tji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"ymfQDHHIW4e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"qSWFw0UStbni5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"S4SxnOCO0bD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"qhqvCx197U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"PtA3tsq5egPdM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"LAJrTgIbywrq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"YGl3ErYOQJtlfg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"gDWQqOThCSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"hAwl5H7T1kc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"8k9brISZio46\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"dfT0AQxFls6uy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"yCucYnVAGhius\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"gvGPbCetIdVf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"AeFWdpIUUxR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"rSD8S0cUKUzqO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"BnwOE8PUKje\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"zYspBAqRHSa0KMR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9gHNCZ1bTPZOcA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"zm4eA92qYoPi1X\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"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_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":653,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":103,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json deleted file mode 100644 index 092ec1b36e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e3cfb9691a5e35b717f161fbbca0340e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"O95DHgod1Ev6iU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"pzgTQQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wtk2BcyV9i4dw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ppoUPDJWRppIE8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"fRaSMBFJSPdn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pNdnU9dzK6SES\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9Tmf1KOQqg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YrUsrv6CI38GU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0YhF2QkmCnX6Ik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rqbZnxksLv07F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"s3fYQX2FWvLDI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ButZMVhwPkoI0gn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"KSbSzk36EXoM45a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rTFIH70eIWe57\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"du8dVoRV8oB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PiClE2NYSlNZV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rlHGlOdxCnopbZn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xJ9n0YkmRaDpx6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"IpbfFV3jX2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"1aJZMGtjAUDMxkF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"szTTNHoUzA7VpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"XQdONVqCPI4t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"n21Yyz0vPYT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"5hQaE0rft\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"fq5cxVrq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"vja5F3qXyk4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DlASwTNWU2HIE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"JrVaTjc8Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kpB3PWZeOsFAUg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JmUXjowrgzd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"9NVc0iwVHSO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"MQSk5dq8VhmtY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"r2E2w7lhgVZN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Bfil22UzuoH0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"7kBafDUUBD8MO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"VDVew84x6ndkGjd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"fSMI1Js3bn8L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"zcBgx5wvmGcK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"CzfMfhBVOTAIimh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"q8YM98H6ZjOkfq7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"jmFZvybTNDb3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"jlIRA8a4WnLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"fcWoUWKWHjvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"eqnqN9d3pI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"0bwfLMTe8JUhy5U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZEqJJGvRBMjZEH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"zPNqkMMTB7oP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6DHJfUcNAJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zPNaiW7Gt1oC1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"oYIlVFvdsy0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"nQ63oFQhSAHSr4I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"bvgxgAU1KKdJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"7FQ4euqOcAC6Uzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"diYv0XvBdVSGzz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"e3iO2m96ygPZwJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"tlrvaGPkVvkzjoQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"yNLCJHGiuMNVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"PyVHHyY71Jvwwoh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"Ghzpor5pwYn2dFe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Rc6HaM0IGkJMY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"BO61MXNphMNz1d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eRZyHyFLusPzw9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"8CTW44tDGRR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"FzVpE5zTKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"xz1St0qVhMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"D0zAWcPvoMCal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"xYHdEL6y4Hcf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"lrqBtx03nv0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"0FDkLsXlIKjSoQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"vqOHV1sIu8Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ozZ59QVCwC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KUF36Qx5e1q9w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"x1SIQII5qpbq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"M27NmxqqcALm58\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ARkd97UcRzt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"9SCnjHe06ER\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"bqjA5ARCOwEb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KHZ2taz2YvjGA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"GO8lHGHC90WoU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"MsqTxAJZi7DO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"u9wfN9zgCSl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"frbcA3LedwBnR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"mAFqLQZug2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"raSauXo5ugu6XZu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"raQLMpgY6EpAKy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"1DHtuAF1srz0kq\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68cb298efa808194aba83aa012e6fcff0b5fc1ca3ed9c367\",\"object\":\"response\",\"created_at\":1758144911,\"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_68cb298f8c308194821a4d47a82596630b5fc1ca3ed9c367\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":718,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":811},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json new file mode 100644 index 0000000000..b44ea6a2cf --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YBTsRxN6Pqr8aK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Oa09xk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"iyvkk0Seu2U7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"fN6jOmSbskZUzf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"m2RoMTYm55hn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"p8xmcA8IGa4Q2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LzebPQNJtR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6Ju6iZKidt8MT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"UEXRtcRmeahDFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"c7Pu9KGuDuzwJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"hrzaswYVgCBAC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"EhJB1jMOvPH0Iyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1LX1OcqDLKQZc14\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"kVhokGzmayCD0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"isOKzT2DiVi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BOiGtTjLIAR28\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"uMpW0KcpiePUkwh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"JEPODMrNkoHoe64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"OIv2Nji05H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"M05GwyqndpJeu9W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"50daD59Bjqz9Di\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"oU6Nfs5kDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"rqXHxwACh7JNn8h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"ysF1oEaGjjxXR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"mVraSlsYpXib\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"tK6MyLzXK4pJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"wZrQhpiUMf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"49fAHQJVv34gN5A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"8qjjRl9HYBlpej\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"DRliywqGs2jd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"uaxG0qZDTY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ntqa84GRwOPpS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"zqar6ag2wce\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"e5jSslc41xxj85P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"6zi53eSzkeN1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"BZmy4M7Mzk7OrqJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"CQEE7WBWhGa2FO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"u6jqamx7Bc4B1Gk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"NpbMaltmFLMCFzG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"GQtbxC3PmMIUT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"D5NgX1NDEESyB5I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"cu9htl06rI7Uumu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"1D1r8MJnPyzUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"XhlHHwG2itAOLg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"zWOuVbBJjYNgdQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KV6h78MEWYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"z74dA1Vs4a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"UE2Y4oi6hw9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"vTcpt3R0Tbtc8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"0wG8TBo7Pn47\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"EVoldUgXa19\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"G0EsS2abjBQP2m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"qftLEYkwtu6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"Ayqh2RFDeR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"jVTLsEh8Ldcol\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"gKzAtUXFsyDW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"arjfYsKJdXrGiT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"MHYvnIhzeec\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"ax3HZBw0hKL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"8kgL3waEBe7A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6CUjpWCEX9LLr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"QaZX91UGgHT5Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"BL0Ukp8btkog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"OwVxXbrkp91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"fXT73q7JNSpTn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"s6HgY3IFJ7N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"2NB9p6pyoMB7HUa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"fCI1K63bkn30Hq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hl8IrzuLubxPDc\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"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_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":86,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json deleted file mode 100644 index 72a14bf038..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_d224b9d8b477962fb9264d15a0c91fef.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OJh8Gz5dcGBleR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"A8ii5f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"MoOuK3PG3oFcN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QhTkAJwCazWC6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"4VQC6zDbruPQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"E273cMUyylwZ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"uYWA7ZILRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6kVy07cs20Pc4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"TPDgtZGmXpUkKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"C8dmQiBSkyUX1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JncRnwwUHh5TF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"frqujOetx3mWe9T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"B1OuNqDU5ee83XZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hOkar0RO0Q8Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SrXUBJ8RpUY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mDxtYMjGQWo6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QClqnnucEJfe9wj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"dxNkvXS7hRhTYVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"nnYU2z99Bl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"rrGVPER2yZ55SyQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"oj70xUQ9PF4YKM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"rPaeiqo7n9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"NPQlJCuzqCf7Dkt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"0dacSeb8NKoHb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"TNU6xgqeH8s2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"D10eTmbXHOcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"c8rlTWwZXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"hXhEDExsLTGGHmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Ewy92PXeaim7VU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"eHHLEiAbWQKu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"V6MKTxfWKg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Z4AQWhoOuS52w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"7ljavRf02mR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"iIYKNHT5hsGMjTr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"oc68bxMv0vdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"PBzsuxEjOjZGMvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"7zZ4RVnXLNlTWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"xH5291ULDVkhIyk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"sWkn4ygtMcrk5pS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"aRTM26lyE9OO5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GBLZaHd1nhtz6B1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"AwZDdvZm6hsQtH0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"TwTmA9GwVBH2z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"08b0iyhvvU5boJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"taGbr3p7PIYCrX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"QvjstpjMvII\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"7TkuOr3SBK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Wq5FHMEDHqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"A0aZdWojKHJ1D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"OWpLGICuF7cz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"hFzbWGCwYZS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rcXtKDahnxguJr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"7mTqUSjvkih\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"v8JedfmPJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5CGwBAl08XFea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"J49jyqHL2cwr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fH4k1mTbqf52Bn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"1QQtt6ePrcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"y8youtnbj5C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"UMtgU8cXSnhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"s1tCEmwGNlhd1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uNVEXM3oVfBhH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"hYPNuwjTS32t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"gBZ3Cf4d84x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"MFhUxFAzJbRR4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"FvyTiezoRhq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"zOhR71w1ihtmypJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"KLiONpK0p8x8Kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QZ3Yjs7Y60NxC1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68cb29916cc88197833553b13ecfa9370ad2c2346aa6d34a\",\"object\":\"response\",\"created_at\":1758144913,\"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_68cb2992041081978a9d90cde7c002880ad2c2346aa6d34a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":734,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":810},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json new file mode 100644 index 0000000000..959a695819 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"aHp4hVE2ymeZSI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8SJM1I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"z8eP45MaPZjsL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"3kb2OU1t3epEFV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"dbw1GzudhXLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yz3y83lf5rTdO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Oo0DH1kI4p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JJFtBwu39xHqD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"cEylPxNpnfXdnX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TPjolTgM3GITW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"3MNDCa2bW6F1m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"k16SLuty9Kb1VWS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ulJTkJHyMcR0zSU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SAeewlEyHPiaO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Cdjdk1LfreJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HOZerBPV3XDXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"c8QJvWnvIwJ00xa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"xARxE5aTug2v4PQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"T3jmMrP349\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"DA9M0soImT71ZhQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"WViaDz7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"44uZSuRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"uC44Xb1gzR3KZcY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jhrhaWBd96hZ6R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4b2jHsF3ZijfRT\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"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_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, updated content

          \\\"}]}\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json deleted file mode 100644 index 1339919c6d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d3b6c677db865d2bbbea74ccc3753b1a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VDG3at3KM0NMro\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"A6dCcM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UmPwqRbEeprLL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FzlU52PuiM13YJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Al9TTnJRxSpA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZVfpnHt57Sl30\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Zd0xHH3J29\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bYOnrMDmxkfvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"da7YaBAd4tOI7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yz32CBc70UmND\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"5J7WStBbsER8J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"XUoLfIsD13uIPn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fJpKGmfUpS9zRDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"02bcM2VYSACf4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"r30FkdmJuru\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UuwcOxWTbbU08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"jTAYxsRUJCu8jbD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"2CodWvZdA5I7Xyf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"q4oVpTxKcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6hNItCYAES27CkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3I3WxZRvgDgCgY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"l38JQYTD4Ymd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JDb5Nij7FK2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"pcFTKGOyr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7NluK00P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"XMZuPV0VlLE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"P5IGj03BP8kdh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"HltRTThml\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"6Z7zOqnzP6fZZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lwCTWB2HQjS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"pMFIjHIwpad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"K6IbjMQEk9vfC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"9b4hEF6B7NOQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"V0wzpDsLHjGX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"PxJ5LROFml3Ld\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"eF1HgCNrJrHfcpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"SEdq73BFb2WZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"6iyJ7sbhdMKT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"4Qs8SiTfXsmEeYe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"70nGEUaHvj1bNXp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"OH2MyHA0awI26P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"3fqPdT6lQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"y6EUdMUNBNuCcIZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"NPZYZFuG7T47q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"e9ygq0Pgozw9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"1dlxtg3cStbd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"tH9DiqMT92\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"cBw5HdDSPvvRESX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ZrlIvkqTvKMS9L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"NggftW2ROd6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"kK1peYqROR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"dMsa83jwpknZ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"UzVS8LIonnY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"jqJ2ELmgRyBHg54\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"TBVlmSNRtPHr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"64143AZuB9GSkfh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"JWOv3eO1Vu6XYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KwN0qUaPbC8EPJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"VZxMdat69TBHuQL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"H57A1QMS9NmKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"AYzVjFX9weArwUT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"R28kqfmXaAowaTU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"e5aZO4CG2lxcC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"L3X4EG8VptyG9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1CttpRhNOJ1iaQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"BEg0HvfATd5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"jeMs5fRWfz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"P1ZyTN4ZTNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gNDQQpXLlsifA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"TMvvvpyT7i7a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"M8aR75PNa3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9DeK2GSS4wsElZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"lRiczLXzAzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"uLoEUUmlTX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"0xUaErygByBdz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"xHcaLcUemxC1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"bFqkDPvMAfaSCt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ZNbSlVxLxc8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"3xL7NpyKNeh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"MkNHsAA0V48S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"hdm2sQ170fhEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uBSh8V7Tt9cK3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"aW4m37XcK6JY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"T2k716CKzLs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"0MWUpwG5SvHRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"ig1DBZzhtJz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"6Lhjutgg6dwoMxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gl4PF974ZRxbvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"t9z5aE2Icn0yxV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68cb299c110481968031b502daa509460fae85e125a09561\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68cb299b5f148196b857da228505e4a30fae85e125a09561\",\"object\":\"response\",\"created_at\":1758144923,\"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_68cb299c110481968031b502daa509460fae85e125a09561\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":814},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json new file mode 100644 index 0000000000..a2ff70037d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"I'll\",\"logprobs\":[],\"obfuscation\":\"zDMdWjJkoq0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" update\",\"logprobs\":[],\"obfuscation\":\"VuEVGSHZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"9UZMRdTjHC9j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" mention\",\"logprobs\":[],\"obfuscation\":\"qkroAWWT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" to\",\"logprobs\":[],\"obfuscation\":\"QbczfGhXWIHoM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" \\\"\",\"logprobs\":[],\"obfuscation\":\"oQ1P4kBs7EZbQP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"OybC2214l1Bi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"etC7J8VX0Jij\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"kcxlwTRO3OXPUrI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" in\",\"logprobs\":[],\"obfuscation\":\"KfHMkcA8uXH7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"c1a23DEhCXDN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" document\",\"logprobs\":[],\"obfuscation\":\"VaCETVt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6KvbKNwuj1w4hdC\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":17,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":18,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}],\"role\":\"assistant\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":20,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"{\\\"\",\"obfuscation\":\"NeO6uQTzBHeCpU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"operations\",\"obfuscation\":\"y3evGs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"D7fL81QJUQqQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"{\\\"\",\"obfuscation\":\"mUNMPMZM2gVLB5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"type\",\"obfuscation\":\"DjefzmydOcNt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m99PlaJC12zpx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"update\",\"obfuscation\":\"zi6ve2OGvT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JGFrppas2vnO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"id\",\"obfuscation\":\"VhThNcErI4s1YP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"93OnlzwtI9j1n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"ref\",\"obfuscation\":\"eykLESvMSgbb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"3RkyG2wcRPqBPyL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"UoqXPAMPmvkyjOl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QEZcGbMTkolrf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"block\",\"obfuscation\":\"zeJLV010aOj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"AYBRmVTGaNtng\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"<\",\"obfuscation\":\"1BFgkZzuFoXtfXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"mohmplCjR7K9rdh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\">Hello\",\"obfuscation\":\"xLN4oMb6b7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"sPqooFg6vgZuCWH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"4QTq8KknGCA0qN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"span\",\"obfuscation\":\"vNlqXIpoVQFE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"aFwBqyznqSP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-inline\",\"obfuscation\":\"FcRe0X2Th\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-content\",\"obfuscation\":\"L8QjDuHU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-type\",\"obfuscation\":\"FP9gJutWBuy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0ulbQudsqZR3r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"mention\",\"obfuscation\":\"m18B0HAEA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"axPq6pHlNGYtor\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"Q0IvDvfUdzs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-user\",\"obfuscation\":\"Ww2IUYrQSAA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"fLf2NiJLehB9n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Jane\",\"obfuscation\":\"BT21B9GBFXQG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" Doe\",\"obfuscation\":\"5gL8uwiC6Enc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"kn2DBpC5fVmIk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"@\",\"obfuscation\":\"oBE6JVAMMCXVE7T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Jane\",\"obfuscation\":\"vD27VMzxeXv5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" Doe\",\"obfuscation\":\"Gpq7uxVdfe0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"3nZRrLoKMC4kJSC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"QS4H0OmDfJDs3D6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"hcgwnneuzduv1F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"strong\",\"obfuscation\":\"MEQMrMjqbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"GzlXDT3yubPpQHr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"How\",\"obfuscation\":\"LcBaDEhdGbQqX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" are\",\"obfuscation\":\"FLZ9IDrJg4Xf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" you\",\"obfuscation\":\"s1l6nfK7tePN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" doing\",\"obfuscation\":\"DvMdBMLd7f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"?\",\"obfuscation\":\"0TYS8m4o1Mtn2Cw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"tRiddnFdBn713D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"span\",\"obfuscation\":\"wsZpDo1gjtBn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" style\",\"obfuscation\":\"Xw3WXIMx4L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"k7aTjlyV8JwHA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"color\",\"obfuscation\":\"CGKWzJ0HfNw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\":\",\"obfuscation\":\"CpunyaiuFEX4ckP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" rgb\",\"obfuscation\":\"4f0DxvblwbYK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"(\",\"obfuscation\":\"2O8QGGRw4Abjwq6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"11\",\"obfuscation\":\"aVDLEjU6jQbjUz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"8a2nQ9sBiRG9cUW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" \",\"obfuscation\":\"OiuqfkTnADDQs2P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"110\",\"obfuscation\":\"bl9TR0qJJsLxU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"4wqGKrdFLBbXaHF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" \",\"obfuscation\":\"67mDnl0LxuYSCZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"153\",\"obfuscation\":\"iKc0qPnq16qEN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\");\",\"obfuscation\":\"JUnNbtcsCxMqGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"Btxnsb4pVxOHXs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"D8imZFBILbB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-style\",\"obfuscation\":\"mZOCnPUAIG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-type\",\"obfuscation\":\"aGui8h5YNZk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"n5GwkiD3MWcBv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"text\",\"obfuscation\":\"rGEPF56OPZ3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":95,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Color\",\"obfuscation\":\"1FDeYtD28me\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":96,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"whMWdVe633f3PE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":97,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"UgqkOU2dU4Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-value\",\"obfuscation\":\"MfsdZwmXi2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"29sWb4WN5QZqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"blue\",\"obfuscation\":\"yUgpxuYTf2Qy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":101,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"OufZ0g4GVpwbNE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":102,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"mwLBhKPNgjM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":103,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-edit\",\"obfuscation\":\"ouUJciP1hat\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":104,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"able\",\"obfuscation\":\"6PQAVPUx42DG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":105,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"hON0YfQgJqWbc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":106,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AD5ahX44Dnl2B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":107,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"This\",\"obfuscation\":\"Jrw53hHD8qkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":108,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" text\",\"obfuscation\":\"qoTTwmuQoh6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":109,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" is\",\"obfuscation\":\"5cNELFwJeri4x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":110,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" blue\",\"obfuscation\":\"9XyNCaBQSMp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":111,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"p9Z9Fq9B0zvy4kn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":116,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"GDbHvdaqgSoKlR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":117,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"]}\",\"obfuscation\":\"f0URPhA0csZdaz\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":118,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":119,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":120,\"response\":{\"id\":\"resp_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}],\"role\":\"assistant\"},{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @Jane Doe! How are you doing? This text is blue!

          \\\"}]}\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":653,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":123,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":776},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json new file mode 100644 index 0000000000..ad6577ea00 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Hx9dSUHKHUmU2D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"HlaWWf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"rIkLbMGIaoLPm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ahgNpUnDtlv9e4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"d70noGgTMn4U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2PELcI04e4lu2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"gwA0VCYvbo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WWmDUdb0hFrDQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"EIdLnwtMItrHdS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CvkRu4cVZtIVo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"U8C0xHYzHCyhI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"VMAgLUTsviv8U89\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"EXk3iXmTG1TOAjL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dXKorqvRplkbH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"W0y16nCEWxl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"o6rtV419K38sR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"J0Fx47CGrVNDsaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"9Mg7wgiriLYgsuX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"qywWInWUDAKZIh2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"eDVnolTZqMg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"cehc0x9vSBjYn1M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"v5eUBT9J6MP5P7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"BQrzF8WmTq6I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"yrD0Q4q4zn6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"lFiIVBHyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"yZyJk8oJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"zHnPABGUPlP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"PQJcjStaRbSd3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"4CdciMASm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"81Y9JkfpOTIATJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"O4XhlTbKY5F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"2axOYRKiktU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"J3RRZgvaZ5ZHI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"zAvZ46x7uYbc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"uilMrD4G4mYu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"4TzAWKtePn5w2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"B6qDQ5pkGmkTb7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"XFC8nD486BPN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"x8RIaO8ecgGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"FrdQcppOWjhxYcw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"DtIAXtgF6iBUyFj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ttygg74OBI6176\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"9WZfCFlwNM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"XmAw4UzvNPmsmYm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"5xuVEc6RjYuQq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"iLcnLYB3QlG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"a8GHMT9yXpD3Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"yHH8bgJiHJY5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"I3TD4QfjBt3HzdP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ur5I3kzJfiJLjK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"YfVkI3vH63Q9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"iqHcIfiXuQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Rto35TOBzmMB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"2JdYReqHp5Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"BJkqEHXptwx0sth\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"hKbvvNikUZBV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"S5rNwJzZ80YQJva\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"oPme9pvQZKEYZZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Je3xTvMzcgWD3hb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"GLgW1gO7l3oNNW8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"C3zn26SwmkbC1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"J8B9rwbRRoOrLuI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"VWW9FtpX8MFxVBq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"iWHUyKpsvytyf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"nhdcQPHo94PTKw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"E0OOx8FS3JYf8H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"JcbBXZWkEyp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"IooCuZMsRB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"ULa68cdFR3b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Hqai3QhFgw2pE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"qpZtq9TUD1T0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"nZ20if6iHJ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"6E5LQA1lfFyikl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ssoaREFoJ2d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"yWtNteAk94\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0Hy5mtcOR4mXm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"Dqa9hdWh8x95\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"GGVwlqo3GsKTAp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"wq2ID34WAuW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"xOxYbOdFSiJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"iklAa1Z9h4FT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"68jspnBgHIzg7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"husB5PPRCXXO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"hlqhxrWXO0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"X4XPDpvPkyB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"MPPrYkP6N7RO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"7bDcZNILcbD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Snp3vfGDaSnM0B3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"oMoLyPh1vmofoi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"8oD7X2vA7tT90p\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"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_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":660,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":109,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json deleted file mode 100644 index 7458f4bfa3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_9c3a4bff186e595440356fe0647f9b31.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ApaxPhkJwty9gf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"24whsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"j1G3Fd716beeM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ogDWtfsL09yxf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"t2IMz2OGVnTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DYjavyGFljVUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"4vEMhBQ3tB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"S0yos7vpsh7A6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"O60yao8u0QbzdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WWIi6Agx0F1FT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wkqnBu9Ni1RuW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ummOEaBJnHB43ps\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lCxXTylRn23WCxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sTKFxw61aIPdf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ubsQ6uok0Yv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NT02RroSoBWPV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UEU9XVzM8tot0AW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"RzGWucG3ekOlHGc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"wrQA0R3IXPuqfFp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"n00QdnvqMIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"uIovyjhDejBK4Bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3YzNMdfx8IO8Lw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KjZiP8NwGZNz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"9qqwVYyYqFm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"uVlN3QNib\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"d0zgwObj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"N3Jv0y4awCg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CogKYXtCAXOLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"pWIVp3RYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"zdK9fh2mN9VSo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"RcJRBmGITRk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"DoDOVlOMy4K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OG6EOvWyUporX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"JWQXnpWYapK3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"r3mNRBKHJHgI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"ZY7oyXRuwYgb6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"0sBjQWespUNbAz2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"GHmFzszSMZLY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"s6jycxbgvOT6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GRy6y304vUPg1XY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ltC41nS8gnjHUXq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"AwYLVJoJr5sadL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"tueRqcFRu4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"btBXtQ6PtsxgZGx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"24VGamNwoXtOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"nukCWfE1CwH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"5Uhg5NNtsZnjB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"yKTeEdYbvz7w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"L4oaBFekQeHgI96\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"jBGmjQc67VuOjY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"DtZySAZ1GXad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"2q0eNipBGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"j1kszk9qAjllM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"B0oENlgarsl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"mROD6vpvFn4DCGR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"zu8AiCkA0AFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"KVmjC6HZt4y9Jha\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"c1l3xrhNzEZ8NR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"WF99lmt3GG6drDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"xr2GMXDzdNDHLer\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"ogMu1uQOppf0a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vs0YKbkuzHqwAOj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"8HVSEPKGuXvc1Gt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"3UzavizbG8Jmf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"E9S2CEE5PlS6NO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CKyBqg36pl3Eix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4FDEifUJS7I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"eOu3BXUyZo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"Iso6v5636D8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"thCLBaZFEU9o7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"nHUjC9hg9tgO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"hL7AHRZli41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TL8emLrzgLXpmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UBkbwSw6iqq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"sH9LPwObeX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DT3zbZdt8DroK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"igxp49WEPx6I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"U3PvhFDToTwfWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"AV0taZBTZdv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"4KeJw9rQlL8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"NHnkLeh3RQC2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cFNe8IfzaF1E4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"ci8XdqiG9Bwix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"uAIySAaUK4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"d6M9ivuNRDP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"rZ8pXEMgurej\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"D1dvD4WCXiR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"sdQPfaaFR3gXrT9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"T1hNWhga3Coyoe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"25FahRexc7Kds1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68cb2a105e7c8195ad1cef2fc50d51f70521e1ea49cfb461\",\"object\":\"response\",\"created_at\":1758145040,\"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_68cb2a11121081959e3ef8065d1e7a820521e1ea49cfb461\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

          \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":824},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json new file mode 100644 index 0000000000..7b18524d21 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lNIJgKH7ZAwf53\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"rGeKA3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hzKFB6Bo8ZwFh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"UZum03yvQCmDMg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tqxpOlpLuqjK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2KesUF5ATyUvu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"nFrv6EFG4J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Cz7i9NyNqqLUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"b7keRDKejgGwOk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2KDbRtSdW5lqe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"yRxvLVNOSBA6I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"QXeB58AfC50uuIS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"jayva8btAYqoSXE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"wb1bCK4WfMxcI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ebZTo9VFlYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TipWvVZJoAbq0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"WIpgtagPoBy5ZjA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"r656xidHUP4p9cR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"IpczUoDN0a0NeK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"rWqoN8eVKR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2LzpHmM2Tf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"xmy2UCyXy6VirRz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"O6HbhoibMH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6KE51ToMYZVjbab\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4NpPTj9BoU6KFG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"2nuw1zAimf4y77\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"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_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":649,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":41,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json new file mode 100644 index 0000000000..b41c00f01f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xF00XhU0d4Mkwf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"wpIhda\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"4nH5yJTFERVtj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"qIQqvTKVImONSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"wQ1HmPbJONH9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zJMPkD9b0NzCi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LciPDUdoYl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4q7bmYjCf5pRW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"GNIq2E1dVodAiP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"66bLXr3KW8vH7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"1X5tt0I1Yk1eV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"KgEKUN0Z5kewCoc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"T7baCFyF1YzTMgq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"iGrok8hzAxYIk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"K8EUmyPE6PI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tQBszMhseYK1b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"GwxwQStqeOzMIP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"dOgQUnZkwVCcvrA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"CWLzDi7ZSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"FqywoyIdWP79EXH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"NKOd443IfMgU4h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"zhSNITVAVH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ehz94XCPO3Ji5Xg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"5UGaoUGSFw1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"lkhzG0jDeQCvqjh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"6P7J8VxPTctQc4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"jJWf67Rr7PmXwg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"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_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":656,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":42,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json new file mode 100644 index 0000000000..0127b216ee --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"UH8zUByVDCdaskF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"atH1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"TSux3Vla8sCLk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"s6CNpA2DmksYBpS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"9yC8QKHXEQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"LgiKnSHkrgse8h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"8Z48oQ8Bi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"kYkYTmQrb8YtJC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"IHMNTe2lliPhn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"T9v1gLKThX3dtT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"KZk16T0968vd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"qwCxQUiiBk18esY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ns4UDfrx7spYcZZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"3oastoxxcPMyWa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"h5kfZWRe8L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"zb24Y8su4dGHch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"ypMvSdR5MXzz7v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"9NlaHCfB75lH5lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"imT2rpLYmN1igEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"2dpXqFm2P6L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"OmBbku7OOEU2Gv4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"2zwYVo5AWMHX5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"mlP9j7OrNik2g4\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":30,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"JYmiZDFmSYdPDNs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"kOfO5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"i5chP0oqR4hOD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"2ryMpeCi7D3f0rn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"xj5sTjAAKkB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"zdFvBLrSJsol8r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"18Qh2Zbep\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"SmruemIdAQ4zpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"8GPU5vu5MbaKS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"kI2eWmxFfahsWE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"XvQ4rrQIr0HT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"fYKszFuP5pedMsb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"WU6O04y4X903cyj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"8z7GrBjoarpi0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"bVORz30qHa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"kX3JLBJEjq3MAz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"vu4LriM2Dj7c4S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"0g8AL3Pptxv2e0i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"uzRTNWCf5zT8XtO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"Mu05r3ezegz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"dGlVGBz8rhTNDU3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"kQ0S6Dzb5XANGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"tfIOdfm3aYud0Rs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"XIY6fIaKNXFyyyO\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"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_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hallo

          \\\"}]}\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":480,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":88,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":568},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json new file mode 100644 index 0000000000..4e0a13c01b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

          I need to buy:

          \\\"},{\\\"block\\\":\\\"

          Apples

          \\\"},{\\\"block\\\":\\\"

          Bananas

          \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"aISRAJ6HwbqdrYN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"Z8F17\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"qKX0EumMh49SR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JQvRUK9frpRTupI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"Vawo3jDq1C3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"oxNAMBzBIMBkbS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"IAukBtbAM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"glhjGY6j7eBG0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"N7Y9xXIaIpCAp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"CyKpveM1HyyDAg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"6VquENsoelD4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"Rn2DKwjE0GE4ndE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"7Hx8blOwIQFapCC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"TyW13iJo9gVDV7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"eshkIhuBZj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"1WyAo94JSoWRI5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"q8aEewyg9a6X3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ZiCoJ7gI09XehZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"hlNageaIwd6KqG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"Dfa9LBXHyvSbXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ma6UqFqeFPdOE2U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"ImAx9osr6W4wfM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"GDpmssPQvS58\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"R7YpSSMq6DVmfkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9nrMUHWO88SfSL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"QYqNZ0PGQyK1SK\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"}]}\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":35,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"b9nk3lxlnamoVhw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"XUskt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"mCFhRP70taceA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"op46HBaWJCnj8iM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"AyjRf6Oyn3t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"QKATvCRhoA9cy8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"8aEMeTSbq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"qkHkgTn6l7bPNF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"ARqWwGUndJ2mw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"55OYvYRS6YxOdE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"YRR8Jjig67Ra\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"3\",\"obfuscation\":\"uT4yLvvVbp24kv7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"HwqV6mj6zLMvJzL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"APzdr2r5yjhm8k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"r6vG5VshUq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"NhqarilWr4GeQi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"ES4kopYbLQaE5o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"ul\",\"obfuscation\":\"sqDJlUdZlr1ipu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"><\",\"obfuscation\":\"WUGwWMRc2MfIa2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"li\",\"obfuscation\":\"NBNOB9VEClKHXU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"ZUthsPT2pXAydr8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"Ban\",\"obfuscation\":\"LwH2PoSXEWGi0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"anas\",\"obfuscation\":\"iEP8EEStYApv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"jDu8Wgc6XjvQnM3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"67mz9A1VbJFENB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"fpqcxH24OcF869N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"8LKrFmLI1F68pnw\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":67,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":68,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":69,\"response\":{\"id\":\"resp_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"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_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
          • Apples
          \\\"}]}\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
          • Bananas
          \\\"}]}\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":400,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":498},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json new file mode 100644 index 0000000000..39ba9d0876 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"SjKwlvKZcFwrCuq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"EZC7c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"GObhMOzBHg1Sz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"EYPIs4FOXXkn3Rm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"2TyF9UgdjnP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"9Kqh8fUJdl5nrn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"DEaC4zNPr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"THBIBbvBZmJ8Dx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"RepDNfQgY8Kh3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"uVeyjvh9BhHMbt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"YFJQQZwSnSFn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"hM7kPuvzJt3EFS1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"qUtfWbsatk6a8Td\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"Y8ZmkVCl75rFKt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"gyNeAdHp16\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"TLXkjdjCiZSRi0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"1Zy3dAhrW1OL26\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"IEKEg0bPwwbAguG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"Kqi6409bpnAUF8m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6AEwjO9UnOCzXbv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"m7wZiuKyRf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"v1xAiE5CJSsRm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"U8ykenAUu0dNiHS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"wEw3eKZsdC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"0rfEm1A30atfqd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"LWH5Lq0nSQC8TX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"]\",\"obfuscation\":\"2Z3ZSdw0stv2l6w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"mBYPxphYTnJTYB3\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"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_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          What's up, world!

          \\\"}]}\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":662,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":58,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":720},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json new file mode 100644 index 0000000000..6d66047f9c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          Hello, @John Doe! How are you doing? This text is blue!

          \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

          Hello, world! Bold text. Link.

          \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"1MfPMMpB1kItuS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"qVTFbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fJfSNAaF4kDZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sVRqaRE4K9jao4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"75InAGUGskLM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"C1NTNwgAWYgYv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Ds5pwXw7wv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DNPq7xO47QzKp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wT1fRr4xPifkX1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"uQnjHNzxG3jli\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"kt3Assgo3LqfN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"ofsCbfMcp90Bqix\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Xq2n48FRQjWcq8E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ocmKPh60k6deo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"FXNBt8GDIVZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TD4kA3ldXvwoe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vmYnl24cWPqGxJc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"qgjpKWVBdRht8WW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"RfQxrigDWPuzJji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"fYcqbEx3qE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"RZB5gradw2zmwwB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"2pxD2v2E3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"v7Oepe16Q5YOtSG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"bbtI0KZdAwLcoS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WGO4YL47VbfO8M\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"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_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"}]}\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":651,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":39,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts index c04964ae87..7275b9fc8f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts @@ -136,12 +136,13 @@ function promptManipulateDocumentUseHTMLBlocks( role: "system", id: "document-state-intro", parts: [ + // TODO: check pre/code { type: "text", text: `You're manipulating a text document using HTML blocks. Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). List items are 1 block with 1 list item each, so block content \`
          • item1
          \` is valid, but \`
          • item1
          • item2
          \` is invalid. We'll merge them automatically. - For code blocks, you can use the \`data-language\` attribute on a code block to specify the language. + For code blocks, you can use the \`data-language\` attribute on a block (wrapped with
          ) to specify the language.
                   This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
                   },
                 ],
          diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
          index a13bfedad4..e241f7896b 100644
          --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
          +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
          @@ -82,16 +82,21 @@ describe("Models", () => {
               {
                 model: testAIModels.openai,
                 stream: true,
          +      generateObject: true,
               },
               {
                 model: testAIModels.openai,
          -      stream: false,
          +      stream: true,
               },
          -    // TODO: https://github.com/vercel/ai/issues/8533
               // {
          -    //   model: testAIModels.groq,
          -    //   stream: true,
          +    //   model: testAIModels.openai,
          +    //   stream: false,
               // },
          +    // TODO: https://github.com/vercel/ai/issues/8533
          +    {
          +      model: testAIModels.groq,
          +      stream: true,
          +    },
               // {
               //   model: testAIModels.groq,
               //   stream: false,
          @@ -103,7 +108,7 @@ describe("Models", () => {
               // },
               {
                 model: testAIModels.anthropic,
          -      stream: false,
          +      stream: true,
               },
               // currently doesn't support streaming
               // https://github.com/vercel/ai/issues/5350
          @@ -120,7 +125,8 @@ describe("Models", () => {
           
             for (const params of testMatrix) {
               describe(`${params.model.provider}/${params.model.modelId} (${
          -      params.stream ? "streaming" : "non-streaming"
          +      (params.stream ? "streaming" : "non-streaming") +
          +      (params.generateObject ? " + generateObject" : "")
               })`, () => {
                 generateSharedTestCases(
                   {
          @@ -130,7 +136,7 @@ describe("Models", () => {
                     transport: new ClientSideTransport({
                       model: params.model,
                       stream: params.stream,
          -            objectGeneration: true,
          +            objectGeneration: params.generateObject,
                       _additionalOptions: {
                         maxRetries: 0,
                       },
          diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
          index 3aca075a98..0fa60a6213 100644
          --- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
          +++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
          @@ -33,6 +33,7 @@ async function* createMockStream(
               yield {
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: false,
          +      metadata: undefined,
                 ...op,
               };
             }
          diff --git a/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts b/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
          index 79960f3342..2ad555c35f 100644
          --- a/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
          +++ b/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
          @@ -38,9 +38,15 @@ describe("MSW Snapshots", () => {
                 .map(([testName, files]) => ({
                   testName: path.basename(testName),
                   count: files.length,
          -        files: files.map((file) => path.basename(file)),
          +        files: files,
                 }));
           
          +    // for (const duplicate of duplicates) {
          +    //   for (const file of duplicate.files) {
          +    //     rmSync(file);
          +    //   }
          +    // }
          +
               // Create error message if duplicates are found
               const errorMessage =
                 duplicates.length > 0
          @@ -48,7 +54,7 @@ describe("MSW Snapshots", () => {
                       `Found duplicate MSW snapshot files for the following (${duplicates.length}) tests:`,
                       ...duplicates.map(
                         ({ testName, count, files }) =>
          -                `  - ${testName}: ${count} files\n    ${files.join("\n    ")}`,
          +                `  - ${testName}: ${count} files\n    ${files.map((file) => path.basename(file)).join("\n    ")}`,
                       ),
                       "",
                       "Each test should have only one snapshot file.",
          diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts
          index 5e50569492..9b08bfa00f 100644
          --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts
          +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts
          @@ -24,6 +24,8 @@ type Operation[] | StreamTool> = {
              * (i.e.: incomplete, streaming in progress)
              */
             isPossiblyPartial: boolean;
          +
          +  metadata: any;
           };
           
           /**
          @@ -40,19 +42,29 @@ type Operation[] | StreamTool> = {
            */
           export class StreamToolExecutor[]> {
             private readonly stream: TransformStream, Operation>;
          -  private readonly readable: ReadableStream>;
          +  private readonly readable: ReadableStream<{
          +    status: "ok";
          +    chunk: Operation;
          +  }>;
           
             /**
              * @param streamTools - The StreamTools to use to apply the StreamToolCalls
              */
          -  constructor(private streamTools: T) {
          +  constructor(
          +    private streamTools: T,
          +    // TODO: use this?
          +    private readonly onChunkComplete?: (
          +      chunk: Operation,
          +      success: boolean,
          +      error?: any,
          +    ) => void,
          +  ) {
               this.stream = this.createWriteStream();
               this.readable = this.createReadableStream();
             }
           
             private createWriteStream() {
               let lastParsedResult: Operation | undefined;
          -
               const stream = new TransformStream, Operation>({
                 transform: async (chunk, controller) => {
                   const operation =
          @@ -83,15 +95,37 @@ export class StreamToolExecutor[]> {
             }
           
             private createReadableStream() {
          -    // this is a bit hacky as it mixes async iterables and streams
          -    // would be better to stick to streams
          -    let currentStream: AsyncIterable[]>> =
          +    // Convert the initial stream to async iterable for tool processing
          +    const source: AsyncIterable[]>> =
                 createAsyncIterableStream(this.stream.readable);
          -    for (const tool of this.streamTools) {
          -      currentStream = tool.execute(currentStream);
          -    }
           
          -    return asyncIterableToStream(currentStream);
          +    const executors = this.streamTools.map((tool) => tool.executor());
          +
          +    const onChunkComplete = this.onChunkComplete;
          +
          +    const iterable = async function* () {
          +      for await (const chunk of source) {
          +        let handled = false;
          +        for (const executor of executors) {
          +          try {
          +            const result = await executor.execute(chunk);
          +            if (result) {
          +              yield { status: "ok", chunk } as const;
          +              handled = true;
          +              break;
          +            }
          +          } catch (error) {
          +            onChunkComplete?.(chunk, false, error);
          +            throw new Error("error bla");
          +          }
          +        }
          +        if (!handled) {
          +          throw new Error("unhandled chunk");
          +        }
          +      }
          +    };
          +    // Convert back to stream for the final output
          +    return asyncIterableToStream(iterable());
             }
           
             /**
          @@ -162,6 +196,7 @@ export class StreamToolExecutor[]> {
                     operation: chunk,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: {},
                   };
                 })(),
               );
          @@ -192,6 +227,7 @@ async function partialJsonToOperation[]>(
                 operation: validated.value as StreamToolCall,
                 isPossiblyPartial: parsed.state === "repaired-parse",
                 isUpdateToPreviousOperation,
          +      metadata: undefined,
               };
             } else {
               // no worries, probably a partial operation that's not valid yet
          diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts
          index 9bcb82a973..a1adc32528 100644
          --- a/packages/xl-ai/src/streamTool/asTool.ts
          +++ b/packages/xl-ai/src/streamTool/asTool.ts
          @@ -26,7 +26,7 @@ export function streamToolsAsTool[]>(streamTools: T) {
             const schema = createStreamToolsArraySchema(streamTools);
           
             return tool({
          -    name: "operations",
          +    name: "applyDocumentOperations",
               inputSchema: jsonSchema(schema, {
                 // validate: (value) => {
                 //   const stream = operationsToStream(value);
          diff --git a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
          index c68e9bdc7f..68b96da0d9 100644
          --- a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
          +++ b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
          @@ -21,7 +21,7 @@ describe("filterNewOrUpdatedOperations", () => {
               }
           
               const result = [];
          -    for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
          +    for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
                 result.push(chunk);
               }
           
          @@ -32,30 +32,35 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 1, content: "op1" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
           
               expect(result[1]).toEqual({
                 partialOperation: { id: 2, content: "op2-partial" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
           
               expect(result[2]).toEqual({
                 partialOperation: { id: 2, content: "op2-complete" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
           
               expect(result[3]).toEqual({
                 partialOperation: { id: 3, content: "op3" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
           
               expect(result[4]).toEqual({
                 partialOperation: { id: 3, content: "op3" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
             });
           
          @@ -74,7 +79,7 @@ describe("filterNewOrUpdatedOperations", () => {
               }
           
               const result = [];
          -    for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
          +    for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
                 result.push(chunk);
               }
           
          @@ -85,6 +90,7 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 1, content: "op1-partial" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
           
               // Second chunk should have op1-complete
          @@ -92,6 +98,7 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 1, content: "op1-complete" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
           
               // Third chunk should have op2
          @@ -99,12 +106,14 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 2, content: "op2" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
           
               expect(result[3]).toEqual({
                 partialOperation: { id: 2, content: "op2" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
             });
           
          @@ -115,7 +124,7 @@ describe("filterNewOrUpdatedOperations", () => {
               }
           
               const result = [];
          -    for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
          +    for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
                 result.push(chunk);
               }
           
          @@ -124,11 +133,13 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 1, content: "op1" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
               expect(result[1]).toEqual({
                 partialOperation: { id: 1, content: "op1" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
             });
           
          @@ -139,7 +150,7 @@ describe("filterNewOrUpdatedOperations", () => {
               }
           
               const result = [];
          -    for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
          +    for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
                 result.push(chunk);
               }
           
          @@ -148,11 +159,13 @@ describe("filterNewOrUpdatedOperations", () => {
                 partialOperation: { id: 1, content: "op1" },
                 isUpdateToPreviousOperation: false,
                 isPossiblyPartial: true,
          +      metadata: {},
               });
               expect(result[1]).toEqual({
                 partialOperation: { id: 1, content: "op1" },
                 isUpdateToPreviousOperation: true,
                 isPossiblyPartial: false,
          +      metadata: {},
               });
             });
           });
          diff --git a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
          index 6f1d17611d..4be2ad0bfe 100644
          --- a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
          +++ b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
          @@ -14,11 +14,13 @@
           export async function* filterNewOrUpdatedOperations(
             partialObjectStream: AsyncIterable<{
               operations?: any[];
          -  }>
          +  }>,
          +  metadata: any,
           ): AsyncGenerator<{
             partialOperation: any;
             isUpdateToPreviousOperation: boolean;
             isPossiblyPartial: boolean;
          +  metadata: any;
           }> {
             let numOperationsAppliedCompletely = 0;
             let first = true;
          @@ -43,6 +45,7 @@ export async function* filterNewOrUpdatedOperations(
                   isUpdateToPreviousOperation:
                     i === numOperationsAppliedCompletely && !first,
                   isPossiblyPartial: i === chunk.operations.length - 1,
          +        metadata,
                 };
                 first = false;
               }
          @@ -60,5 +63,6 @@ export async function* filterNewOrUpdatedOperations(
               partialOperation: lastOp,
               isUpdateToPreviousOperation: true,
               isPossiblyPartial: false,
          +    metadata,
             };
           }
          diff --git a/packages/xl-ai/src/streamTool/filterValidOperations.test.ts b/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
          index 016829b65b..1ad0f993f5 100644
          --- a/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
          +++ b/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
          @@ -21,6 +21,7 @@ describe("filterValidOperations", () => {
                   } as Result | UpdateBlockToolCall>,
                   isUpdateToPreviousOperation: false,
                   isPossiblyPartial: false,
          +        metadata: undefined,
                 };
           
                 yield {
          @@ -30,6 +31,7 @@ describe("filterValidOperations", () => {
                   } as Result | UpdateBlockToolCall>,
                   isUpdateToPreviousOperation: false,
                   isPossiblyPartial: false,
          +        metadata: undefined,
                 };
           
                 yield {
          @@ -43,6 +45,7 @@ describe("filterValidOperations", () => {
                   } as Result | UpdateBlockToolCall>,
                   isUpdateToPreviousOperation: true,
                   isPossiblyPartial: true,
          +        metadata: undefined,
                 };
               }
           
          @@ -81,6 +84,7 @@ describe("filterValidOperations", () => {
                   } as Result | UpdateBlockToolCall>,
                   isUpdateToPreviousOperation: false,
                   isPossiblyPartial: false,
          +        metadata: undefined,
                 };
           
                 yield {
          @@ -90,6 +94,7 @@ describe("filterValidOperations", () => {
                   } as Result | UpdateBlockToolCall>,
                   isUpdateToPreviousOperation: true,
                   isPossiblyPartial: false,
          +        metadata: undefined,
                 };
               }
           
          diff --git a/packages/xl-ai/src/streamTool/filterValidOperations.ts b/packages/xl-ai/src/streamTool/filterValidOperations.ts
          index 3f06db50f1..91b513a4f4 100644
          --- a/packages/xl-ai/src/streamTool/filterValidOperations.ts
          +++ b/packages/xl-ai/src/streamTool/filterValidOperations.ts
          @@ -10,6 +10,7 @@ export async function* filterValidOperations(
               operation: Result;
               isUpdateToPreviousOperation: boolean;
               isPossiblyPartial: boolean;
          +    metadata: any;
             }>,
             onInvalidOperation?: (chunk: {
               operation: Result & {
          @@ -17,11 +18,13 @@ export async function* filterValidOperations(
               };
               isUpdateToPreviousOperation: boolean;
               isPossiblyPartial: boolean;
          +    metadata: any;
             }) => void,
           ): AsyncGenerator<{
             operation: T;
             isUpdateToPreviousOperation: boolean;
             isPossiblyPartial: boolean;
          +  metadata: any;
           }> {
             let forceNewOperation = false;
             for await (const chunk of operationsStream) {
          @@ -33,6 +36,7 @@ export async function* filterValidOperations(
                     ? false
                     : chunk.isUpdateToPreviousOperation,
                   isPossiblyPartial: chunk.isPossiblyPartial,
          +        metadata: chunk.metadata,
                 };
                 forceNewOperation = false;
               } else {
          diff --git a/packages/xl-ai/src/streamTool/jsonSchema.ts b/packages/xl-ai/src/streamTool/jsonSchema.ts
          index b55f3a5269..03784dca2e 100644
          --- a/packages/xl-ai/src/streamTool/jsonSchema.ts
          +++ b/packages/xl-ai/src/streamTool/jsonSchema.ts
          @@ -65,6 +65,8 @@ export function createStreamToolsArraySchema(
               type: "object",
               properties: {
                 operations: {
          +        //description:
          +        // "Operations to apply to the document. Put all operations in this array in ONE tool call / function call. DO NOT use multiple operation arrays with parallel tool calls.",
                   type: "array",
                   items: {
                     anyOf: schemas.map((schema) => schema.schema),
          diff --git a/packages/xl-ai/src/streamTool/preprocess.test.ts b/packages/xl-ai/src/streamTool/preprocess.test.ts
          index ba608aaee3..814c6455f5 100644
          --- a/packages/xl-ai/src/streamTool/preprocess.test.ts
          +++ b/packages/xl-ai/src/streamTool/preprocess.test.ts
          @@ -78,6 +78,7 @@ describe("preprocess", () => {
                     partialOperation: addOperationValid,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
           
          @@ -94,11 +95,13 @@ describe("preprocess", () => {
                     partialOperation: addOperationInvalidId,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: true,
          +          metadata: undefined,
                   };
                   yield {
                     partialOperation: invalidOperationType,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: true,
          +          metadata: undefined,
                   };
                 }
           
          @@ -115,11 +118,13 @@ describe("preprocess", () => {
                     partialOperation: addOperationInvalidId,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                   yield {
                     partialOperation: invalidOperationType,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
           
          @@ -150,6 +155,7 @@ describe("preprocess", () => {
                     partialOperation: addOperationValid,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
           
          @@ -166,6 +172,7 @@ describe("preprocess", () => {
                     partialOperation: addOperationInvalidId,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
           
          @@ -182,6 +189,7 @@ describe("preprocess", () => {
                     partialOperation: invalidOperationType,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
           
          diff --git a/packages/xl-ai/src/streamTool/preprocess.ts b/packages/xl-ai/src/streamTool/preprocess.ts
          index 71cba2d567..8292eec7e0 100644
          --- a/packages/xl-ai/src/streamTool/preprocess.ts
          +++ b/packages/xl-ai/src/streamTool/preprocess.ts
          @@ -6,6 +6,7 @@ export type PreprocessOperationResult[]> = {
             operation: StreamToolCall;
             isUpdateToPreviousOperation: boolean;
             isPossiblyPartial: boolean;
          +  metadata: any;
           };
           
           /**
          @@ -18,6 +19,7 @@ export async function* preprocessOperationsStreaming<
               partialOperation: any;
               isUpdateToPreviousOperation: boolean;
               isPossiblyPartial: boolean;
          +    metadata: any;
             }>,
             streamTools: T,
           ): AsyncGenerator> {
          @@ -55,6 +57,7 @@ export async function* preprocessOperationsNonStreaming<
               partialOperation: any;
               isUpdateToPreviousOperation: boolean;
               isPossiblyPartial: boolean;
          +    metadata: any;
             }>,
             streamTools: T,
           ): AsyncGenerator> {
          diff --git a/packages/xl-ai/src/streamTool/streamTool.ts b/packages/xl-ai/src/streamTool/streamTool.ts
          index 00ddfc184b..91f5b1eb71 100644
          --- a/packages/xl-ai/src/streamTool/streamTool.ts
          +++ b/packages/xl-ai/src/streamTool/streamTool.ts
          @@ -45,17 +45,14 @@ export type StreamTool = {
              *
              * @returns the stream of operations that have not been processed (and should be passed on to execute handlers of other StreamTools)
              */
          -  execute: (
          -    operationsStream: AsyncIterable<{
          +  executor: () => {
          +    execute: (chunk: {
                 operation: StreamToolCall[]>;
                 isUpdateToPreviousOperation: boolean;
                 isPossiblyPartial: boolean;
          -    }>,
          -  ) => AsyncIterable<{
          -    operation: StreamToolCall[]>;
          -    isUpdateToPreviousOperation: boolean;
          -    isPossiblyPartial: boolean;
          -  }>;
          +      metadata: any;
          +    }) => Promise;
          +  };
           };
           
           export type StreamToolCallSingle> =
          diff --git a/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts b/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
          index cc4010efe4..69dea922a6 100644
          --- a/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
          +++ b/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
          @@ -81,6 +81,7 @@ describe("toValidatedOperations", () => {
                     partialOperation: operation,
                     isUpdateToPreviousOperation: false,
                     isPossiblyPartial: false,
          +          metadata: undefined,
                   };
                 }
               }
          diff --git a/packages/xl-ai/src/streamTool/toValidatedOperations.ts b/packages/xl-ai/src/streamTool/toValidatedOperations.ts
          index 0b19668cda..f1dd5af047 100644
          --- a/packages/xl-ai/src/streamTool/toValidatedOperations.ts
          +++ b/packages/xl-ai/src/streamTool/toValidatedOperations.ts
          @@ -12,12 +12,14 @@ export async function* toValidatedOperations[]>(
               partialOperation: any;
               isUpdateToPreviousOperation: boolean;
               isPossiblyPartial: boolean;
          +    metadata: any;
             }>,
             streamTools: T,
           ): AsyncGenerator<{
             operation: Result>;
             isUpdateToPreviousOperation: boolean;
             isPossiblyPartial: boolean;
          +  metadata: any;
           }> {
             for await (const chunk of partialObjectStream) {
               const func = streamTools.find(
          @@ -34,6 +36,7 @@ export async function* toValidatedOperations[]>(
                   },
                   isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
                   isPossiblyPartial: chunk.isPossiblyPartial,
          +        metadata: chunk.metadata,
                 };
                 continue;
               }
          @@ -44,6 +47,7 @@ export async function* toValidatedOperations[]>(
                 operation,
                 isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
                 isPossiblyPartial: chunk.isPossiblyPartial,
          +      metadata: chunk.metadata,
               };
             }
           }
          diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
          index 78498d016c..2310bcca0e 100644
          --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
          +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
          @@ -107,7 +107,10 @@ export class ClientSideTransport
                 ...((_additionalOptions ?? {}) as any),
               });
           
          -    return objectAsToolCallInUIMessageStream(ret.object, "operations"); // TODO, better not hardcode
          +    return objectAsToolCallInUIMessageStream(
          +      ret.object,
          +      "applyDocumentOperations",
          +    ); // TODO, better not hardcode
             }
           
             /**
          @@ -161,7 +164,7 @@ export class ClientSideTransport
               // Transform the partial object stream to a data stream format
               return partialObjectStreamAsToolCallInUIMessageStream(
                 ret.fullStream,
          -      "operations", // TODO, better not hardcode
          +      "applyDocumentOperations", // TODO, better not hardcode
               );
             }
           
          @@ -177,13 +180,14 @@ export class ClientSideTransport
                 model,
                 messages: convertToModelMessages(messages),
                 tools: {
          -        operations: tool({
          -          name: "operations",
          +        applyDocumentOperations: tool({
          +          name: "applyDocumentOperations",
                     inputSchema: jsonSchema(streamToolJSONSchema),
                   }),
                 },
                 // extra options for streamObject
                 ...((_additionalOptions ?? {}) as any),
          +      // activeTools: ["applyDocumentOperations"],
               });
           
               return ret.toUIMessageStream();
          diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts
          index a677c1ef44..012303098f 100644
          --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts
          +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts
          @@ -33,6 +33,8 @@ type OperationsResult[]> = AsyncIterableStream<{
              * For non-streaming mode, this will always be `false`
              */
             isPossiblyPartial: boolean;
          +
          +  metadata: any;
           }>;
           
           // stream vs generate, responsibility of backend
          @@ -41,23 +43,28 @@ type OperationsResult[]> = AsyncIterableStream<{
           export function UIMessageStreamToOperationsResult[]>(
             stream: ReadableStream,
             streamTools: T,
          +  chunkMetadata: any,
           ): OperationsResult {
             const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough(
               textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(),
             );
           
             // Note: we can probably clean this up by switching to streams instead of async iterables
          -  return objectStreamToOperationsResult(ret, streamTools);
          +  return objectStreamToOperationsResult(ret, streamTools, chunkMetadata);
           }
           
           export function objectStreamToOperationsResult[]>(
             stream: ReadableStream[] }>>,
             streamTools: T,
          +  chunkMetadata: any,
           ): OperationsResult {
             // Note: we can probably clean this up by switching to streams instead of async iterables
             return createAsyncIterableStreamFromAsyncIterable(
               preprocessOperationsStreaming(
          -      filterNewOrUpdatedOperations(createAsyncIterableStream(stream)),
          +      filterNewOrUpdatedOperations(
          +        createAsyncIterableStream(stream),
          +        chunkMetadata,
          +      ),
                 streamTools,
               ),
             );
          diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          index 4ff3153f48..6165867385 100644
          --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          @@ -6,17 +6,55 @@ import { StreamToolExecutor } from "../../StreamToolExecutor.js";
           import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsResult.js";
           
           // TODO: comment file + design decisions
          +// TODO: add notice about single executor (with downside that maybe streamtools must be changeable?)
          +
          +function createAppendableStream() {
          +  let controller: ReadableStreamDefaultController;
          +  let ready = Promise.resolve();
          +
          +  const output = new ReadableStream({
          +    start(c) {
          +      controller = c;
          +    },
          +  });
          +
          +  async function append(readable: ReadableStream) {
          +    const reader = readable.getReader();
          +
          +    // Chain appends in sequence
          +    ready = ready.then(async () => {
          +      // eslint-disable-next-line no-constant-condition
          +      while (true) {
          +        const { done, value } = await reader.read();
          +        if (done) {
          +          break;
          +        }
          +        controller.enqueue(value);
          +      }
          +    });
          +
          +    return ready;
          +  }
          +
          +  async function finalize() {
          +    await ready; // wait for last appended stream to finish
          +    controller.close(); // only close once no more streams will come
          +  }
          +
          +  return { output, append, finalize };
          +}
           
           // Types for tool call streaming
           type ToolCallStreamData = {
          -  stream: TransformStream[] }>>;
          +  // stream: TransformStream[] }>>;
             writer: WritableStreamDefaultWriter<
               DeepPartial<{ operations: StreamToolCall[] }>
             >;
             complete: boolean;
             toolName: string;
             toolCallId: string;
          -  executor: StreamToolExecutor;
          +  operationsStream: ReadableStream;
          +  // executor: StreamToolExecutor;
           };
           
           /**
          @@ -36,7 +74,7 @@ function processToolCallParts(
           
               const toolName = part.type.replace("tool-", "");
           
          -    if (toolName !== "operations") {
          +    if (toolName !== "applyDocumentOperations") {
                 // we only process the combined operations tool call
                 // in a future improvement we can add more generic support for different tool streaming
                 continue;
          @@ -67,19 +105,17 @@ function createToolCallStream(
             const operationsStream = objectStreamToOperationsResult(
               stream.readable,
               streamTools,
          +    { toolCallId },
             );
          -  const writer = stream.writable.getWriter();
          -
          -  const executor = new StreamToolExecutor(streamTools);
           
          -  // Pipe operations directly into this tool call's executor
          -  operationsStream.pipeTo(executor.writable);
          +  const writer = stream.writable.getWriter();
           
             return {
          -    stream,
          +    // stream,
               writer,
               complete: false,
          -    executor,
          +    // executor,
          +    operationsStream,
               toolName,
               toolCallId,
             };
          @@ -116,6 +152,19 @@ export async function setupToolCallStreaming(
             chat: Chat,
             onStart?: () => void,
           ) {
          +  let erroredChunk: any | undefined;
          +
          +  const executor = new StreamToolExecutor(streamTools, (chunk, success) => {
          +    console.log("chunk", chunk, success);
          +    if (!success) {
          +      erroredChunk = chunk;
          +    }
          +  });
          +
          +  const appendableStream = createAppendableStream();
          +
          +  appendableStream.output.pipeTo(executor.writable);
          +
             const toolCallStreams = new Map();
           
             let first = true;
          @@ -128,6 +177,7 @@ export async function setupToolCallStreaming(
                     data.toolName,
                     data.toolCallId,
                   );
          +        appendableStream.append(toolCallStreamData.operationsStream);
                   toolCallStreams.set(data.toolCallId, toolCallStreamData);
                   if (first) {
                     first = false;
          @@ -173,33 +223,56 @@ export async function setupToolCallStreaming(
             //  instead of waiting for the entire llm response)
             await statusHandler;
           
          +  // we're not going to append any more streams from tool calls, because we've seen all tool calls
          +  await appendableStream.finalize();
          +
             // let all stream executors finish, this can take longer due to artificial delays
             // (e.g. to simulate human typing behaviour)
          +  const result = (await Promise.allSettled([executor.waitTillEnd()]))[0];
           
          -  const toolCalls = Array.from(toolCallStreams.values());
          -  const results = await Promise.allSettled(
          -    toolCalls.map((data) => data.executor.waitTillEnd()),
          -  );
          +  if (result.status === "rejected" && !erroredChunk) {
          +    throw new Error(
          +      "Unexpected: executor.waitTillEnd() rejected but no erroredChunk",
          +      { cause: result.reason },
          +    );
          +  }
           
          +  let errorSeen = false;
             // process results
          -  results.forEach((result, index) => {
          +  const toolCalls = Array.from(toolCallStreams.values());
          +  toolCalls.forEach((toolCall, index) => {
          +    const isErrorTool =
          +      toolCall.toolCallId === erroredChunk?.metadata.toolCallId;
          +    let error: string | undefined;
          +    if (isErrorTool) {
          +      if (result.status === "fulfilled") {
          +        throw new Error(
          +          "Unexpected: executor.waitTillEnd() fulfilled but erroredChunk",
          +          { cause: erroredChunk },
          +        );
          +      }
          +      error = getErrorMessage(result.reason);
          +      errorSeen = true;
          +    }
          +
               chat.addToolResult({
                 tool: toolCalls[index].toolName,
                 toolCallId: toolCalls[index].toolCallId,
                 output:
          -        result.status === "fulfilled"
          +        errorSeen === false
                     ? { status: "ok" }
          -          : { status: "error", error: getErrorMessage(result.reason) },
          +          : isErrorTool
          +            ? { status: "error", error }
          +            : { status: "not-executed-previous-tool-errored" },
               });
             });
           
          +  if (result.status === "rejected") {
          +    throw result.reason;
          +  }
          +
             if (chat.error) {
               // response failed
               throw chat.error;
             }
          -
          -  // response succeeded, but (one of the) tool calls failed
          -  if (results.some((result) => result.status === "rejected")) {
          -    throw new Error("Tool call failed");
          -  }
           }
          
          From fa0ae06bb2074894e686273201d9eeeff36d29d9 Mon Sep 17 00:00:00 2001
          From: yousefed 
          Date: Fri, 19 Sep 2025 12:13:24 +0200
          Subject: [PATCH 45/68] remove log
          
          ---
           packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts | 1 -
           1 file changed, 1 deletion(-)
          
          diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          index 6165867385..b8079758b7 100644
          --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
          @@ -155,7 +155,6 @@ export async function setupToolCallStreaming(
             let erroredChunk: any | undefined;
           
             const executor = new StreamToolExecutor(streamTools, (chunk, success) => {
          -    console.log("chunk", chunk, success);
               if (!success) {
                 erroredChunk = chunk;
               }
          
          From 265826601dc51f2eeff7a2fb00aace00ef6b3d50 Mon Sep 17 00:00:00 2001
          From: yousefed 
          Date: Fri, 19 Sep 2025 15:23:50 +0200
          Subject: [PATCH 46/68] fix build
          
          ---
           examples/09-ai/05-manual-execution/src/App.tsx | 2 ++
           1 file changed, 2 insertions(+)
          
          diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx
          index 23a66d1cfe..a167c79b1a 100644
          --- a/examples/09-ai/05-manual-execution/src/App.tsx
          +++ b/examples/09-ai/05-manual-execution/src/App.tsx
          @@ -121,6 +121,7 @@ export default function App() {
                         isUpdateToPreviousOperation: false,
                         // this operation is a partial update and will be "completed" by the next update
                         isPossiblyPartial: true,
          +              metadata: {},
                       });
                       await new Promise((resolve) => setTimeout(resolve, 3000));
                       writer.write({
          @@ -134,6 +135,7 @@ export default function App() {
                         isUpdateToPreviousOperation: true,
                         // this operation is not a partial update, we've received the entire invocation
                         isPossiblyPartial: false,
          +              metadata: {},
                       });
           
                       // close the writer
          
          From 8e9dd341d040fa3cda8e53da3b31a8ba0b36985e Mon Sep 17 00:00:00 2001
          From: yousefed 
          Date: Tue, 23 Sep 2025 10:22:01 +0200
          Subject: [PATCH 47/68] simplify a lot
          
          ---
           .../09-ai/05-manual-execution/src/App.tsx     |  18 +--
           .../09-ai/06-server-promptbuilder/src/App.tsx |   6 +-
           packages/xl-ai/src/AIExtension.ts             |  42 +++++--
           packages/xl-ai/src/api/LLMRequest.ts          | 100 -----------------
           .../defaultAIRequestSender.ts}                |  20 ++--
           packages/xl-ai/src/api/aiRequest/execute.ts   |  92 ++++++++++++++++
           packages/xl-ai/src/api/aiRequest/index.ts     |   3 +
           packages/xl-ai/src/api/aiRequest/types.ts     |  52 +++++++++
           .../xl-ai/src/api/formats/PromptBuilder.ts    |  16 +--
           .../src/api/formats/html-blocks/htmlBlocks.ts |  41 +++----
           .../api/formats/html-blocks/htmlPromptData.ts |  21 ++--
           packages/xl-ai/src/api/formats/index.ts       |  72 ++++++++++++
           .../api/formats/json/errorHandling.test.ts    |  15 ++-
           .../xl-ai/src/api/formats/json/json.test.ts   |   4 +-
           .../src/api/formats/json/jsonPromptData.ts    |  23 ++--
           .../api/formats/json/tools/jsontools.test.ts  |   2 -
           .../markdown-blocks/markdownBlocks.test.ts    |   4 +-
           .../markdown-blocks/markdownPromptData.ts     |  24 ++--
           .../src/api/formats/tests/sharedTestCases.ts  |  21 +++-
           packages/xl-ai/src/api/index.ts               |  56 +---------
           .../src/streamTool/StreamToolExecutor.ts      |  92 +++++++++-------
           .../vercelAiSdk/util/chatHandlers.ts          |   2 +-
           packages/xl-ai/src/types.ts                   | 103 +++---------------
           23 files changed, 423 insertions(+), 406 deletions(-)
           delete mode 100644 packages/xl-ai/src/api/LLMRequest.ts
           rename packages/xl-ai/src/api/{formats/promptAIRequestSender.ts => aiRequest/defaultAIRequestSender.ts} (63%)
           create mode 100644 packages/xl-ai/src/api/aiRequest/execute.ts
           create mode 100644 packages/xl-ai/src/api/aiRequest/index.ts
           create mode 100644 packages/xl-ai/src/api/aiRequest/types.ts
           create mode 100644 packages/xl-ai/src/api/formats/index.ts
          
          diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx
          index a167c79b1a..ab63afdb46 100644
          --- a/examples/09-ai/05-manual-execution/src/App.tsx
          +++ b/examples/09-ai/05-manual-execution/src/App.tsx
          @@ -75,10 +75,6 @@ export default function App() {
                         id: blockToChange,
                         block: "

          Open source software is cool

          ", }); - - // make sure the executor is done - await executor.waitTillEnd(); - // accept the changes after 1 second await new Promise((resolve) => setTimeout(resolve, 1000)); await getAIExtension(editor).acceptChanges(); @@ -138,11 +134,8 @@ export default function App() { metadata: {}, }); - // close the writer - writer.close(); - - // wait till the executor is done - await executor.waitTillEnd(); + await writer.close(); + await executor.finish(); // accept the changes after 1 second await new Promise((resolve) => setTimeout(resolve, 1000)); @@ -189,11 +182,8 @@ export default function App() { "

          This Open source software like Hello World refers to computer programs, this is a longer update, let's write a first sentence that's quite long long long long here. And now let's write a second sentence.

          " }`); - // close the writer - writer.close(); - - // wait till the executor is done - await executor.waitTillEnd(); + await writer.close(); + await executor.finish(); // accept the changes after 1 second await new Promise((resolve) => setTimeout(resolve, 1000)); diff --git a/examples/09-ai/06-server-promptbuilder/src/App.tsx b/examples/09-ai/06-server-promptbuilder/src/App.tsx index 9114590077..6aa1ba2a9c 100644 --- a/examples/09-ai/06-server-promptbuilder/src/App.tsx +++ b/examples/09-ai/06-server-promptbuilder/src/App.tsx @@ -15,9 +15,9 @@ import { AIMenuController, AIToolbarButton, createAIExtension, + defaultAIRequestSender, getAISlashMenuItems, llmFormats, - promptAIRequestSender, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; @@ -61,13 +61,13 @@ export default function App() { return { body: { + ...body, // TODO: this conversation id is client-side generated, we // should have a server-side generated id to ensure uniqueness // see https://github.com/vercel/ai/issues/7340#issuecomment-3307559636 id, // get the promptData from requestMetadata (set by `promptAIRequestSender`) and send to backend promptData: (requestMetadata as any).promptData, - ...body, lastToolParts, // messages, -> we explicitly don't send the messages array as we compose messages server-side }, @@ -75,7 +75,7 @@ export default function App() { }, }), // customize the aiRequestSender to not update the messages array on the client-side - aiRequestSender: promptAIRequestSender( + aiRequestSender: defaultAIRequestSender( async () => {}, // disable the client-side promptbuilder llmFormats.html.defaultPromptInputDataBuilder, ), diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts index 8e6806223a..d29026b049 100644 --- a/packages/xl-ai/src/AIExtension.ts +++ b/packages/xl-ai/src/AIExtension.ts @@ -14,7 +14,13 @@ import { Fragment, Slice } from "prosemirror-model"; import { Plugin, PluginKey } from "prosemirror-state"; import { fixTablesKey } from "prosemirror-tables"; import { createStore, StoreApi } from "zustand/vanilla"; -import { doLLMRequest } from "./api/LLMRequest.js"; + +import { + buildAIRequest, + defaultAIRequestSender, + executeAIRequest, + llmFormats, +} from "./api/index.js"; import { createAgentCursorPlugin } from "./plugins/AgentCursorPlugin.js"; import { LLMRequestHelpers, LLMRequestOptions } from "./types.js"; @@ -78,7 +84,7 @@ export class AIExtension extends BlockNoteExtension { /** * Returns a zustand store with the global configuration of the AI Extension. - * These options are used by default across all LLM calls when calling {@link doLLMRequest} + * These options are used by default across all LLM calls when calling {@link executeLLMRequest} */ public readonly options: ReturnType< ReturnType> @@ -271,7 +277,7 @@ export class AIExtension extends BlockNoteExtension { * * @warning This method should usually only be used for advanced use-cases * if you want to implement how an LLM call is executed. Usually, you should - * use {@link doLLMRequest} instead which will handle the status updates for you. + * use {@link executeLLMRequest} instead which will handle the status updates for you. */ public setAIResponseStatus( status: @@ -316,6 +322,8 @@ export class AIExtension extends BlockNoteExtension { /** * Execute a call to an LLM and apply the result to the editor + * + * TODO: "AI" or "LLM"? */ public async callLLM(opts: LLMRequestOptions) { this.setAIResponseStatus("thinking"); @@ -344,11 +352,21 @@ export class AIExtension extends BlockNoteExtension { ...opts, } as LLMRequestOptions; - await doLLMRequest( - this.editor, + const sender = + opts.aiRequestSender ?? + defaultAIRequestSender( + llmFormats.html.defaultPromptBuilder, + llmFormats.html.defaultPromptInputDataBuilder, + ); + + const aiRequest = buildAIRequest({ + editor: this.editor, chat, - opts, - (blockId: string) => { + userPrompt: opts.userPrompt, + useSelection: opts.useSelection, + deleteEmptyCursorBlock: opts.deleteEmptyCursorBlock, + streamToolsProvider: opts.streamToolsProvider, + onBlockUpdated: (blockId: string) => { // NOTE: does this setState with an anon object trigger unnecessary re-renders? this._store.setState({ aiMenuState: { @@ -357,10 +375,16 @@ export class AIExtension extends BlockNoteExtension { }, }); }, - () => { + }); + + await executeAIRequest({ + aiRequest, + sender, + chatRequestOptions: opts.chatRequestOptions, + onStart: () => { this.setAIResponseStatus("ai-writing"); }, - ); + }); this.setAIResponseStatus("user-reviewing"); } catch (e) { diff --git a/packages/xl-ai/src/api/LLMRequest.ts b/packages/xl-ai/src/api/LLMRequest.ts deleted file mode 100644 index a7c5e5e086..0000000000 --- a/packages/xl-ai/src/api/LLMRequest.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Chat } from "@ai-sdk/react"; -import { BlockNoteEditor } from "@blocknote/core"; -import { UIMessage } from "ai"; -import { setupToolCallStreaming } from "../streamTool/vercelAiSdk/util/chatHandlers.js"; -import { LLMRequestOptions } from "../types.js"; -import { isEmptyParagraph } from "../util/emptyBlock.js"; -import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; -import { promptAIRequestSender } from "./formats/promptAIRequestSender.js"; -import { llmFormats } from "./index.js"; -import { trimEmptyBlocks } from "./promptHelpers/trimEmptyBlocks.js"; - -// TODO: figure out naming of this vs. aiRequest etc -export async function doLLMRequest( - editor: BlockNoteEditor, - chat: Chat, - opts: LLMRequestOptions, - onBlockUpdated?: (blockId: string) => void, - onStart?: () => void, -) { - const { - userPrompt, - useSelection, - deleteEmptyCursorBlock, - streamToolsProvider, - promptBuilder, - transport, // TODO: unused - ...rest - } = { - deleteEmptyCursorBlock: true, // default true - ...opts, - }; - - let { aiRequestSender } = { - ...rest, - }; - - if (aiRequestSender && promptBuilder) { - throw new Error("messageSender and promptBuilder cannot be used together"); - } - - if (!aiRequestSender) { - aiRequestSender = promptAIRequestSender( - promptBuilder ?? llmFormats.html.defaultPromptBuilder, - llmFormats.html.defaultPromptInputDataBuilder, - ); - } - - const cursorBlock = useSelection - ? undefined - : editor.getTextCursorPosition().block; - - const emptyCursorBlockToDelete: string | undefined = - cursorBlock && - deleteEmptyCursorBlock && - isEmptyParagraph(cursorBlock) && - trimEmptyBlocks(editor.document).length > 0 - ? cursorBlock.id - : undefined; - - const selectionInfo = useSelection - ? editor.getSelectionCutBlocks() - : undefined; - - const streamTools = ( - streamToolsProvider ?? htmlBlockLLMFormat.getStreamToolsProvider() - ).getStreamTools( - editor, - selectionInfo - ? { - from: selectionInfo._meta.startPos, - to: selectionInfo._meta.endPos, - } - : undefined, - onBlockUpdated, - ); - - const executePromise = setupToolCallStreaming(streamTools, chat, () => { - onStart?.(); - if (emptyCursorBlockToDelete && editor.getBlock(emptyCursorBlockToDelete)) { - editor.removeBlocks([emptyCursorBlockToDelete]); - } - }); - - await aiRequestSender.sendAIRequest( - { - editor: editor, - chat, - blockNoteUserPrompt: { - userPrompt, - selectedBlocks: selectionInfo?.blocks, - streamTools, - emptyCursorBlockToDelete, - }, - }, - opts.chatRequestOptions, - ); - - // TODO: what if no tool calls were made? - await executePromise; -} diff --git a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts b/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts similarity index 63% rename from packages/xl-ai/src/api/formats/promptAIRequestSender.ts rename to packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts index c12d083bf9..a5260044ec 100644 --- a/packages/xl-ai/src/api/formats/promptAIRequestSender.ts +++ b/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts @@ -1,20 +1,20 @@ import { createStreamToolsArraySchema } from "../../streamTool/jsonSchema.js"; -import { AIRequestSender } from "../../types.js"; -import { HTMLPromptData } from "./html-blocks/htmlPromptData.js"; -import { PromptBuilder, PromptInputDataBuilder } from "./PromptBuilder.js"; +import { HTMLPromptData } from "../formats/html-blocks/htmlPromptData.js"; +import { + PromptBuilder, + PromptInputDataBuilder, +} from "../formats/PromptBuilder.js"; +import { AIRequestSender } from "./types.js"; // TODO: naming -export function promptAIRequestSender( +export function defaultAIRequestSender( promptBuilder: PromptBuilder, promptInputDataBuilder: PromptInputDataBuilder, ): AIRequestSender { return { async sendAIRequest(aiRequest, options) { // build the prompt data - const promptData = await promptInputDataBuilder( - aiRequest.editor, - aiRequest.blockNoteUserPrompt, - ); + const promptData = await promptInputDataBuilder(aiRequest); // update the chat history with new messages based on the prompt data await promptBuilder(aiRequest.chat.messages, promptData); @@ -24,9 +24,7 @@ export function promptAIRequestSender( ...options, body: { ...(options?.body ?? {}), - streamTools: createStreamToolsArraySchema( - aiRequest.blockNoteUserPrompt.streamTools, - ), + streamTools: createStreamToolsArraySchema(aiRequest.streamTools), }, // we pass the promptData as metadata // so the transport can decide whether or not to submit this to the server diff --git a/packages/xl-ai/src/api/aiRequest/execute.ts b/packages/xl-ai/src/api/aiRequest/execute.ts new file mode 100644 index 0000000000..24f8a9d78d --- /dev/null +++ b/packages/xl-ai/src/api/aiRequest/execute.ts @@ -0,0 +1,92 @@ +import { Chat } from "@ai-sdk/react"; +import { BlockNoteEditor } from "@blocknote/core"; +import { ChatRequestOptions, UIMessage } from "ai"; +import { setupToolCallStreaming } from "../../streamTool/vercelAiSdk/util/chatHandlers.js"; +import { isEmptyParagraph } from "../../util/emptyBlock.js"; +import { llmFormats, StreamToolsProvider } from "../index.js"; +import { trimEmptyBlocks } from "../promptHelpers/trimEmptyBlocks.js"; +import { AIRequest, AIRequestSender } from "./types.js"; + +export function buildAIRequest(opts: { + editor: BlockNoteEditor; + chat: Chat; + userPrompt: string; + useSelection?: boolean; + deleteEmptyCursorBlock?: boolean; + streamToolsProvider?: StreamToolsProvider; + onBlockUpdated?: (blockId: string) => void; +}) { + const { useSelection, deleteEmptyCursorBlock, streamToolsProvider } = { + ...opts, + useSelection: opts.useSelection ?? false, + deleteEmptyCursorBlock: opts.deleteEmptyCursorBlock ?? true, + streamToolsProvider: + opts.streamToolsProvider ?? llmFormats.html.getStreamToolsProvider(), + }; + const cursorBlock = useSelection + ? undefined + : opts.editor.getTextCursorPosition().block; + + const emptyCursorBlockToDelete: string | undefined = + cursorBlock && + deleteEmptyCursorBlock && + isEmptyParagraph(cursorBlock) && + trimEmptyBlocks(opts.editor.document).length > 0 + ? cursorBlock.id + : undefined; + + const selectionInfo = useSelection + ? opts.editor.getSelectionCutBlocks() + : undefined; + + const streamTools = streamToolsProvider.getStreamTools( + opts.editor, + selectionInfo + ? { + from: selectionInfo._meta.startPos, + to: selectionInfo._meta.endPos, + } + : undefined, + opts.onBlockUpdated, + ); + + return { + editor: opts.editor, + chat: opts.chat, + userPrompt: opts.userPrompt, + selectedBlocks: selectionInfo?.blocks, + streamTools, + emptyCursorBlockToDelete, + }; +} + +/** + * Sends an LLM Request to the LLM backend and processes streaming tool calls + * made by the LLM + */ +export async function executeAIRequest(opts: { + aiRequest: AIRequest; + sender: AIRequestSender; + chatRequestOptions?: ChatRequestOptions; + onStart?: () => void; +}) { + const { aiRequest, sender, chatRequestOptions, onStart } = opts; + const executePromise = setupToolCallStreaming( + aiRequest.streamTools, + aiRequest.chat, + () => { + onStart?.(); + if ( + aiRequest.emptyCursorBlockToDelete && + aiRequest.editor.getBlock(aiRequest.emptyCursorBlockToDelete) + ) { + aiRequest.editor.removeBlocks([aiRequest.emptyCursorBlockToDelete]); + } + }, + ); + + await sender.sendAIRequest(aiRequest, chatRequestOptions); + + // TODO: what if no tool calls were made? + await executePromise; +} diff --git a/packages/xl-ai/src/api/aiRequest/index.ts b/packages/xl-ai/src/api/aiRequest/index.ts new file mode 100644 index 0000000000..5b4dd7c24a --- /dev/null +++ b/packages/xl-ai/src/api/aiRequest/index.ts @@ -0,0 +1,3 @@ +export * from "./defaultAIRequestSender.js"; +export * from "./execute.js"; +export * from "./types.js"; diff --git a/packages/xl-ai/src/api/aiRequest/types.ts b/packages/xl-ai/src/api/aiRequest/types.ts new file mode 100644 index 0000000000..0399f236d0 --- /dev/null +++ b/packages/xl-ai/src/api/aiRequest/types.ts @@ -0,0 +1,52 @@ +import { Chat } from "@ai-sdk/react"; +import { Block, BlockNoteEditor } from "@blocknote/core"; +import { UIMessage } from "ai"; +import { StreamTool } from "../../streamTool/streamTool.js"; +import { ChatRequestOptions } from "../../types.js"; + +/** + * An AIRequest represents a user request for an editor AI call + */ +export type AIRequest = { + /** + * The editor from which we can read document state + */ + editor: BlockNoteEditor; + + /** + * The chat object (from the AI SDK) + * is used to keep Message history, and to submit the LLM request via the underlying transport to the LLM + */ + chat: Chat; + + /** + * The user's prompt + */ + userPrompt: string; + + /** + * The selection of the editor which the LLM should operate on + */ + selectedBlocks?: Block[]; + + /** + * The id of the block that should be excluded from the LLM call, + * this is used when using the AI slash menu in an empty block + */ + emptyCursorBlockToDelete?: string; + + /** + * The stream tools that can be used by the LLM + */ + streamTools: StreamTool[]; +}; + +/** + * Responsible for submitting a BlockNote `AIRequest` to the Vercel AI SDK. + */ +export type AIRequestSender = { + sendAIRequest: ( + AIRequest: AIRequest, + options: ChatRequestOptions, + ) => Promise; +}; diff --git a/packages/xl-ai/src/api/formats/PromptBuilder.ts b/packages/xl-ai/src/api/formats/PromptBuilder.ts index b8ac5d6dda..ba4239ab53 100644 --- a/packages/xl-ai/src/api/formats/PromptBuilder.ts +++ b/packages/xl-ai/src/api/formats/PromptBuilder.ts @@ -1,6 +1,5 @@ -import { BlockNoteEditor } from "@blocknote/core"; import { UIMessage } from "ai"; -import { BlockNoteUserPrompt } from "../../types.js"; +import { AIRequest } from "../../index.js"; /** * We want users to be able to easily customize the prompts send to an LLM, @@ -15,16 +14,9 @@ export type PromptBuilder = ( ) => Promise; /** - * A separate function that builds the input data for the PromptBuilder based on the BlockNoteUserPrompt and - * current document (editor state). + * A separate function that builds the input data for the PromptBuilder based on the AIRequest. * - * This is split from the PromptBuilder so that if you want, you can build the input data on the client side, + * This is split from the PromptBuilder so that for example, you can build the input data on the client side, * and run the PromptBuilder on the server side to modify the Messages sent to the LLM. - * - * The default implementation (using promptAIRequestSender) handles all of this client-side and just submits the - * modified messages to the LLM. */ -export type PromptInputDataBuilder = ( - editor: BlockNoteEditor, - blockNoteUserPrompt: BlockNoteUserPrompt, -) => Promise; +export type PromptInputDataBuilder = (aiRequest: AIRequest) => Promise; diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index 7f0d9812be..106a633fc1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -10,28 +10,11 @@ import { import { tools } from "./tools/index.js"; // Import the tool call types -import { StreamToolsProvider } from "../../index.js"; -import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; -import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; -import { DeleteBlockToolCall } from "../base-tools/delete.js"; - -// Define the tool types -export type AddTool = StreamTool>; -export type UpdateTool = StreamTool>; -export type DeleteTool = StreamTool; - -// Create a conditional type that maps boolean flags to tool types -export type StreamToolsConfig = { - add?: boolean; - update?: boolean; - delete?: boolean; -}; - -export type StreamToolsResult = [ - ...(T extends { update: true } ? [UpdateTool] : []), - ...(T extends { add: true } ? [AddTool] : []), - ...(T extends { delete: true } ? [DeleteTool] : []), -]; +import { + StreamToolsConfig, + StreamToolsProvider, + StreamToolsResult, +} from "../index.js"; function getStreamTools< T extends StreamToolsConfig = { add: true; update: true; delete: true }, @@ -46,7 +29,7 @@ function getStreamTools< } | boolean, onBlockUpdate?: (blockId: string) => void, -): StreamToolsResult { +): StreamToolsResult { if (typeof selectionInfo === "boolean") { const selection = selectionInfo ? editor.getSelectionCutBlocks() @@ -87,16 +70,18 @@ function getStreamTools< : []), ]; - return streamTools as StreamToolsResult; + return streamTools as StreamToolsResult; } export const htmlBlockLLMFormat = { /** * Function to get the stream tools that can apply HTML block updates to the editor */ - getStreamToolsProvider: ( - opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ): StreamToolsProvider => ({ + getStreamToolsProvider: < + T extends StreamToolsConfig = { add: true; update: true; delete: true }, + >( + opts: { withDelays?: boolean; defaultStreamTools?: T } = {}, + ): StreamToolsProvider => ({ getStreamTools: (editor, selectionInfo, onBlockUpdate) => { return getStreamTools( editor, @@ -108,6 +93,8 @@ export const htmlBlockLLMFormat = { }, }), + tools, + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts index cb5d32036d..1e99d5b94f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts @@ -1,5 +1,5 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; -import { BlockNoteUserPrompt } from "../../../types.js"; +import { AIRequest } from "../../../index.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; @@ -14,24 +14,23 @@ export type HTMLPromptData = ( }; export async function defaultHTMLPromptInputDataBuilder( - editor: BlockNoteEditor, - blockNoteUserPrompt: BlockNoteUserPrompt, + aiRequest: AIRequest, ): Promise { - if (blockNoteUserPrompt.selectedBlocks) { + if (aiRequest.selectedBlocks) { return { - ...(await getDataForPromptWithSelection(editor, { - selectedBlocks: blockNoteUserPrompt.selectedBlocks, + ...(await getDataForPromptWithSelection(aiRequest.editor, { + selectedBlocks: aiRequest.selectedBlocks, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } else { return { - ...(await getDataForPromptNoSelection(editor, { - excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete - ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + ...(await getDataForPromptNoSelection(aiRequest.editor, { + excludeBlockIds: aiRequest.emptyCursorBlockToDelete + ? [aiRequest.emptyCursorBlockToDelete] : undefined, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } } diff --git a/packages/xl-ai/src/api/formats/index.ts b/packages/xl-ai/src/api/formats/index.ts new file mode 100644 index 0000000000..1b5a7b2c67 --- /dev/null +++ b/packages/xl-ai/src/api/formats/index.ts @@ -0,0 +1,72 @@ +import { BlockNoteEditor } from "@blocknote/core"; +import { StreamTool } from "../../streamTool/streamTool.js"; +import { AddBlocksToolCall } from "./base-tools/createAddBlocksTool.js"; +import { UpdateBlockToolCall } from "./base-tools/createUpdateBlockTool.js"; +import { DeleteBlockToolCall } from "./base-tools/delete.js"; +import { htmlBlockLLMFormat } from "./html-blocks/htmlBlocks.js"; +import { HTMLPromptData } from "./html-blocks/htmlPromptData.js"; +import { jsonBlockLLMFormat } from "./json/json.js"; +import { markdownBlockLLMFormat } from "./markdown-blocks/markdownBlocks.js"; +import { PromptBuilder } from "./PromptBuilder.js"; + +// Define the tool types +export type AddTool = StreamTool>; +export type UpdateTool = StreamTool>; +export type DeleteTool = StreamTool; + +// Create a conditional type that maps boolean flags to tool types +export type StreamToolsConfig = { + add?: boolean; + update?: boolean; + delete?: boolean; +}; + +export type StreamToolsResult = [ + ...(T extends { update: true } ? [UpdateTool] : []), + ...(T extends { add: true } ? [AddTool] : []), + ...(T extends { delete: true } ? [DeleteTool] : []), +]; + +export type StreamToolsProvider< + TT, + T extends StreamToolsConfig = { add: true; update: true; delete: true }, +> = { + getStreamTools: ( + editor: BlockNoteEditor, + selectionInfo?: + | { + from: number; + to: number; + } + | boolean, + onBlockUpdate?: (blockId: string) => void, + ) => StreamToolsResult; +}; + +export type LLMFormat = { + /** + * Function to get the stream tools that can apply HTML block updates to the editor + */ + getStreamToolsProvider: ( + withDelays: boolean, + defaultStreamTools?: T, + ) => StreamToolsProvider; + /** + * The default PromptBuilder that determines how a userPrompt is converted to an array of + * LLM Messages (CoreMessage[]) + */ + defaultPromptBuilder: PromptBuilder; + /** + * Helper functions which can be used when implementing a custom PromptBuilder. + * The signature depends on the specific format + */ + promptHelpers: any; +}; + +export const llmFormats = { + _experimental_json: jsonBlockLLMFormat, + _experimental_markdown: markdownBlockLLMFormat, + html: htmlBlockLLMFormat, +}; + +export * from "./PromptBuilder.js"; diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index 41d066a579..c4c93c41df 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -8,8 +8,10 @@ import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; import { Chat } from "@ai-sdk/react"; import { UIMessage } from "ai"; +import { llmFormats } from "../../../index.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js"; +import { buildAIRequest, executeAIRequest } from "../../aiRequest/execute.js"; // Create client and models outside of test suites so they can be shared const client = createBlockNoteAIClient({ @@ -87,9 +89,18 @@ describe.skip("Error handling", () => { objectGeneration: true, // TODO: switch to text }), }); - await doLLMRequest(editor, chat, { + const aiRequest = buildAIRequest({ + editor, + chat, userPrompt: "translate to Spanish", }); + await executeAIRequest({ + aiRequest, + sender: defaultAIRequestSender( + llmFormats.html.defaultPromptBuilder, + llmFormats.html.defaultPromptInputDataBuilder, + ), + }); } catch (error: any) { errorThrown = true; caughtError = error; diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts index 4b87db97f3..e53cbe7602 100644 --- a/packages/xl-ai/src/api/formats/json/json.test.ts +++ b/packages/xl-ai/src/api/formats/json/json.test.ts @@ -8,8 +8,8 @@ import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; +import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js"; import { llmFormats } from "../../index.js"; -import { promptAIRequestSender } from "../promptAIRequestSender.js"; const BASE_FILE_PATH = path.resolve( __dirname, @@ -118,7 +118,7 @@ describe.skip("Models", () => { llmFormats._experimental_json.getStreamToolsProvider({ withDelays: false, }), - aiRequestSender: promptAIRequestSender( + aiRequestSender: defaultAIRequestSender( llmFormats._experimental_json.defaultPromptBuilder, llmFormats._experimental_json.defaultPromptInputDataBuilder, ), diff --git a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts index fe3392b4da..2c9b0395fc 100644 --- a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts +++ b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts @@ -1,5 +1,5 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; -import { BlockNoteUserPrompt } from "../../../types.js"; +import { AIRequest } from "../../../index.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; @@ -13,25 +13,22 @@ export type JSONPromptData = ( userPrompt: string; }; -export async function defaultJSONPromptDataBuilder( - editor: BlockNoteEditor, - blockNoteUserPrompt: BlockNoteUserPrompt, -) { - if (blockNoteUserPrompt.selectedBlocks) { +export async function defaultJSONPromptDataBuilder(aiRequest: AIRequest) { + if (aiRequest.selectedBlocks) { return { - ...(await getDataForPromptWithSelection(editor, { - selectedBlocks: blockNoteUserPrompt.selectedBlocks, + ...(await getDataForPromptWithSelection(aiRequest.editor, { + selectedBlocks: aiRequest.selectedBlocks, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } else { return { - ...(await getDataForPromptNoSelection(editor, { - excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete - ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + ...(await getDataForPromptNoSelection(aiRequest.editor, { + excludeBlockIds: aiRequest.emptyCursorBlockToDelete + ? [aiRequest.emptyCursorBlockToDelete] : undefined, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } } diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts index 0fa60a6213..6791375a1f 100644 --- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts +++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts @@ -62,8 +62,6 @@ async function executeTestCase( await executor.execute(stream); - await executor.waitTillEnd(); - validateRejectingResultsInOriginalDoc(editor, originalDoc); getAIExtension(editor).acceptChanges(); diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts index be36595a7a..6142f99fd4 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts @@ -7,8 +7,8 @@ import path from "path"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { testAIModels } from "../../../testUtil/testAIModels.js"; +import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js"; import { llmFormats } from "../../index.js"; -import { promptAIRequestSender } from "../promptAIRequestSender.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; const BASE_FILE_PATH = path.resolve( @@ -118,7 +118,7 @@ describe("Models", () => { llmFormats._experimental_markdown.getStreamToolsProvider({ withDelays: false, }), - aiRequestSender: promptAIRequestSender( + aiRequestSender: defaultAIRequestSender( llmFormats._experimental_markdown.defaultPromptBuilder, llmFormats._experimental_markdown.defaultPromptInputDataBuilder, ), diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts index 328c85de6d..faec6bf397 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts @@ -1,5 +1,6 @@ import { Block, BlockNoteEditor } from "@blocknote/core"; -import { BlockNoteUserPrompt } from "../../../types.js"; + +import { AIRequest } from "../../../index.js"; import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js"; import { convertBlocks } from "../../promptHelpers/convertBlocks.js"; import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js"; @@ -13,25 +14,22 @@ export type MarkdownPromptData = ( userPrompt: string; }; -export async function defaultMarkdownPromptDataBuilder( - editor: BlockNoteEditor, - blockNoteUserPrompt: BlockNoteUserPrompt, -) { - if (blockNoteUserPrompt.selectedBlocks) { +export async function defaultMarkdownPromptDataBuilder(aiRequest: AIRequest) { + if (aiRequest.selectedBlocks) { return { - ...(await getDataForPromptWithSelection(editor, { - selectedBlocks: blockNoteUserPrompt.selectedBlocks, + ...(await getDataForPromptWithSelection(aiRequest.editor, { + selectedBlocks: aiRequest.selectedBlocks, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } else { return { - ...(await getDataForPromptNoSelection(editor, { - excludeBlockIds: blockNoteUserPrompt.emptyCursorBlockToDelete - ? [blockNoteUserPrompt.emptyCursorBlockToDelete] + ...(await getDataForPromptNoSelection(aiRequest.editor, { + excludeBlockIds: aiRequest.emptyCursorBlockToDelete + ? [aiRequest.emptyCursorBlockToDelete] : undefined, })), - userPrompt: blockNoteUserPrompt.userPrompt, + userPrompt: aiRequest.userPrompt, }; } } diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts index f90e3a4510..a1dc26783b 100644 --- a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts +++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts @@ -5,6 +5,7 @@ import path from "path"; import { TextSelection } from "prosemirror-state"; import { describe, expect, it } from "vitest"; import { getAIExtension } from "../../../AIExtension.js"; +import { defaultAIRequestSender, llmFormats } from "../../../index.js"; import { addOperationTestCases } from "../../../testUtil/cases/addOperationTestCases.js"; import { combinedOperationsTestCases } from "../../../testUtil/cases/combinedOperationsTestCases.js"; import { deleteOperationTestCases } from "../../../testUtil/cases/deleteOperationTestCases.js"; @@ -15,7 +16,7 @@ import { import { updateOperationTestCases } from "../../../testUtil/cases/updateOperationTestCases.js"; import { validateRejectingResultsInOriginalDoc } from "../../../testUtil/suggestChangesTestUtil.js"; import { LLMRequestHelpers } from "../../../types.js"; -import { doLLMRequest } from "../../LLMRequest.js"; +import { buildAIRequest, executeAIRequest } from "../../aiRequest/execute.js"; const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__"); @@ -79,10 +80,24 @@ export function generateSharedTestCases( transport: aiOptions.transport, }); - await doLLMRequest(editor, chat, { + const aiRequest = buildAIRequest({ + editor, + chat, userPrompt: test.userPrompt, useSelection: selection !== undefined, - ...aiOptions, + streamToolsProvider: aiOptions.streamToolsProvider, + }); + const sender = + aiOptions.aiRequestSender ?? + defaultAIRequestSender( + llmFormats.html.defaultPromptBuilder, + llmFormats.html.defaultPromptInputDataBuilder, + ); + + await executeAIRequest({ + aiRequest, + sender, + chatRequestOptions: aiOptions.chatRequestOptions, }); // const result = await callLLM(editor, { diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts index 635c6bbd58..a12d884a67 100644 --- a/packages/xl-ai/src/api/index.ts +++ b/packages/xl-ai/src/api/index.ts @@ -1,55 +1,3 @@ -import { BlockNoteEditor } from "@blocknote/core"; -import { StreamTool } from "../streamTool/streamTool.js"; -import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js"; -import { HTMLPromptData } from "./formats/html-blocks/htmlPromptData.js"; -import { jsonBlockLLMFormat } from "./formats/json/json.js"; -import { markdownBlockLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js"; -import { PromptBuilder } from "./formats/PromptBuilder.js"; - -export type StreamToolsProvider = { - getStreamTools: ( - editor: BlockNoteEditor, - selectionInfo?: - | { - from: number; - to: number; - } - | boolean, - onBlockUpdate?: (blockId: string) => void, - ) => StreamTool[]; -}; -export type LLMFormat = { - /** - * Function to get the stream tools that can apply HTML block updates to the editor - */ - getStreamToolsProvider: ( - withDelays: boolean, - defaultStreamTools?: { - add?: boolean; - update?: boolean; - delete?: boolean; - }, - ) => StreamToolsProvider; - /** - * The default PromptBuilder that determines how a userPrompt is converted to an array of - * LLM Messages (CoreMessage[]) - */ - defaultPromptBuilder: PromptBuilder; - /** - * Helper functions which can be used when implementing a custom PromptBuilder. - * The signature depends on the specific format - */ - promptHelpers: any; -}; - -export const llmFormats = { - _experimental_json: jsonBlockLLMFormat, - _experimental_markdown: markdownBlockLLMFormat, - html: htmlBlockLLMFormat, -}; - -// export { doLLMRequest as callLLM } from "./LLMRequest.js"; -// export { LLMResponse } from "./LLMResponse.js"; -export { promptAIRequestSender } from "./formats/promptAIRequestSender.js"; -export * from "./formats/PromptBuilder.js"; +export * from "./aiRequest/index.js"; +export * from "./formats/index.js"; export { promptHelpers } from "./promptHelpers/index.js"; diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index 9b08bfa00f..850cb47b31 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -1,8 +1,4 @@ import { parsePartialJson } from "ai"; -import { - asyncIterableToStream, - createAsyncIterableStream, -} from "../util/stream.js"; import { StreamTool, StreamToolCall } from "./streamTool.js"; /** @@ -41,11 +37,15 @@ type Operation[] | StreamTool> = { * @example see the `manual-execution` example */ export class StreamToolExecutor[]> { - private readonly stream: TransformStream, Operation>; - private readonly readable: ReadableStream<{ - status: "ok"; - chunk: Operation; - }>; + private readonly stream: TransformStream< + string | Operation, + { + status: "ok"; + chunk: Operation; + } + > & { + finishPromise: Promise; + }; /** * @param streamTools - The StreamTools to use to apply the StreamToolCalls @@ -59,11 +59,10 @@ export class StreamToolExecutor[]> { error?: any, ) => void, ) { - this.stream = this.createWriteStream(); - this.readable = this.createReadableStream(); + this.stream = this.createStream(); } - private createWriteStream() { + private createStream() { let lastParsedResult: Operation | undefined; const stream = new TransformStream, Operation>({ transform: async (chunk, controller) => { @@ -91,26 +90,41 @@ export class StreamToolExecutor[]> { }, }); - return stream; - } + // - internal dummy sink ensures all downstream writes are completed. + // - pipeline.close() waits for both the first writable to close and the pipe to finish internally, so the consumer doesn’t need to know about internal transforms. + // - Works regardless of the number of internal transforms. + // - The readable can still be exposed if the consumer wants it, but they don’t have to consume it for close() to guarantee processing is done. - private createReadableStream() { - // Convert the initial stream to async iterable for tool processing - const source: AsyncIterable[]>> = - createAsyncIterableStream(this.stream.readable); + const secondTransform = stream.readable.pipeThrough(this.createExecutor()); - const executors = this.streamTools.map((tool) => tool.executor()); + const [internalReadable, externalReadable] = secondTransform.tee(); + + // internalReadable goes to the dummy sink + const finishPromise = internalReadable.pipeTo(new WritableStream()); + return { + writable: stream.writable, + // expose externalReadable to the consumer + readable: externalReadable, + finishPromise, + }; + } + + private createExecutor() { + const executors = this.streamTools.map((tool) => tool.executor()); const onChunkComplete = this.onChunkComplete; - const iterable = async function* () { - for await (const chunk of source) { + return new TransformStream< + Operation, + { status: "ok"; chunk: Operation } + >({ + transform: async (chunk, controller) => { let handled = false; for (const executor of executors) { try { const result = await executor.execute(chunk); if (result) { - yield { status: "ok", chunk } as const; + controller.enqueue({ status: "ok", chunk }); handled = true; break; } @@ -122,34 +136,32 @@ export class StreamToolExecutor[]> { if (!handled) { throw new Error("unhandled chunk"); } - } - }; - // Convert back to stream for the final output - return asyncIterableToStream(iterable()); - } - - /** - * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results. - */ - public async waitTillEnd() { - const iterable = createAsyncIterableStream(this.readable); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - for await (const _result of iterable) { - // no op - // these will be operations without a matching StreamTool. - // (we probably want to allow a way to access and handle these, but for now we haven't run into this scenario yet) - } + }, + }); } /** * Returns a WritableStream that can be used to write StreamToolCalls to the executor. * * The WriteableStream accepts JSON strings or Operation objects. + * + * Make sure to call `close` on the StreamToolExecutor instead of on the writable returned here! */ public get writable() { return this.stream.writable; } + /** + * Returns a ReadableStream that can be used to read the results of the executor. + */ + public get readable() { + return this.stream.readable; + } + + public async finish() { + await this.stream.finishPromise; + } + async executeOperationsArray(source: AsyncIterable) { const writer = this.writable.getWriter(); for await (const chunk of source) { @@ -169,6 +181,7 @@ export class StreamToolExecutor[]> { await writer.write(chunk); } await writer.close(); + await this.finish(); } /** @@ -182,6 +195,7 @@ export class StreamToolExecutor[]> { await writer.write(chunk); } await writer.close(); + await this.finish(); } /** diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index b8079758b7..8ade313616 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -227,7 +227,7 @@ export async function setupToolCallStreaming( // let all stream executors finish, this can take longer due to artificial delays // (e.g. to simulate human typing behaviour) - const result = (await Promise.allSettled([executor.waitTillEnd()]))[0]; + const result = (await Promise.allSettled([executor.close()]))[0]; if (result.status === "rejected" && !erroredChunk) { throw new Error( diff --git a/packages/xl-ai/src/types.ts b/packages/xl-ai/src/types.ts index ac35f750c0..e8856ea5c2 100644 --- a/packages/xl-ai/src/types.ts +++ b/packages/xl-ai/src/types.ts @@ -1,10 +1,6 @@ import { Chat } from "@ai-sdk/react"; -import { Block, BlockNoteEditor } from "@blocknote/core"; import { ChatTransport, UIMessage } from "ai"; -import type { PromptBuilder } from "./api/formats/PromptBuilder.js"; -import { HTMLPromptData } from "./api/formats/html-blocks/htmlPromptData.js"; -import { StreamToolsProvider } from "./index.js"; -import { StreamTool } from "./streamTool/streamTool.js"; +import { AIRequestSender, StreamToolsProvider } from "./index.js"; /** * Extra options (header, body, metadata) that can be passed to LLM requests @@ -12,66 +8,14 @@ import { StreamTool } from "./streamTool/streamTool.js"; */ export type ChatRequestOptions = Parameters["sendMessage"]>[1]; -/** - * Information about the user request and which streamtools are available - */ -export type BlockNoteUserPrompt = { - /** - * The user's prompt - */ - userPrompt: string; - /** - * The selection of the editor which the LLM should operate on - */ - selectedBlocks?: Block[]; - /** - * The id of the block that should be excluded from the LLM call, - * this is used when using the AI slash menu in an empty block - */ - emptyCursorBlockToDelete?: string; - - /** - * The stream tools that can be used by the LLM - */ - streamTools: StreamTool[]; -}; - -/** - * An AIRequest represents a user request for an editor AI call - */ -export type AIRequest = { - /** - * The editor from which we can read document state - */ - editor: BlockNoteEditor; - - /** - * The chat object (from the AI SDK) - * is used to keep Message history, and to submit the LLM request via the underlying transport to the LLM - */ - chat: Chat; - - /** - * Information about the user request and which streamtools are available - */ - blockNoteUserPrompt: BlockNoteUserPrompt; -}; - -/** - * Responsible for sending the AI request to the LLM backend - */ -export type AIRequestSender = { - sendAIRequest: ( - AIRequest: AIRequest, - options: ChatRequestOptions, - ) => Promise; -}; - export type LLMRequestHelpers = { /** - * Customize how your LLM backend is called. - * Implement this function if you want to call a backend that is not compatible with - * the Vercel AI SDK + * The Vercel AI SDK transport is responsible for sending the AI SDK Request to the LLM backend + * + * Implement this function if you want to: + * - use a custom backend + * - change backend URLs + * - use a different transport layer (e.g.: websockets) */ transport?: ChatTransport; @@ -85,32 +29,15 @@ export type LLMRequestHelpers = { * This is a pattern we take from the Vercel AI SDK */ chatRequestOptions?: ChatRequestOptions; -} & ( - | { - /** - * The `PromptBuilder` to use for the LLM call - * - * (A PromptBuilder is a function that takes a BlockNoteEditor and details about the user's prompt - * and turns it into an AI SDK `CoreMessage` array to be passed to the LLM) - * - * TODO - * @default provided by the format (e.g. `llm.html.defaultPromptBuilder`) - */ - promptBuilder?: PromptBuilder; - aiRequestSender?: never; - } - | { - // aiRequestSender variant - promptBuilder?: never; - /** - * Responsible for sending the AI request to the LLM backend - * - * @default promptAIRequestSender - */ - aiRequestSender?: AIRequestSender; - } -); + /** + * Responsible for submitting a BlockNote `AIRequest` to the Vercel AI SDK. + * Use this to transform the messages sent to the LLM + * + * @default `defaultAIRequestSender(llmFormats.html.defaultPromptBuilder, llmFormats.html.defaultPromptInputDataBuilder)` + */ + aiRequestSender?: AIRequestSender; +}; export type LLMRequestOptions = { /** From 179f152ca03343fee20d452cec6ef220a41506bc Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 23 Sep 2025 10:27:44 +0200 Subject: [PATCH 48/68] add test --- .../formats/html-blocks/htmlBlocks.test.ts | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index e241f7896b..2971a2b71d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -2,9 +2,11 @@ import { getCurrentTest } from "@vitest/runner"; import { getSortedEntries, snapshot, toHashString } from "msw-snapshot"; import { setupServer } from "msw/node"; import path from "path"; -import { afterAll, afterEach, beforeAll, describe } from "vitest"; +import { afterAll, afterEach, beforeAll, describe, it } from "vitest"; import { testAIModels } from "../../../testUtil/testAIModels.js"; +import { BlockNoteEditor } from "@blocknote/core"; +import { StreamToolExecutor } from "../../../streamTool/StreamToolExecutor.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; import { generateSharedTestCases } from "../tests/sharedTestCases.js"; import { htmlBlockLLMFormat } from "./htmlBlocks.js"; @@ -151,3 +153,45 @@ describe("Models", () => { }); } }); + +describe("streamToolsProvider", () => { + it("should return the correct stream tools", () => { + // test skipped, this is only to validate type inference + return; + + // eslint-disable-next-line no-unreachable + const editor = BlockNoteEditor.create(); + const streamTools = htmlBlockLLMFormat + .getStreamToolsProvider({ + defaultStreamTools: { + add: true, + }, + }) + .getStreamTools(editor, true); + + const executor = new StreamToolExecutor(streamTools); + + executor.executeOne({ + type: "add", + blocks: ["

          test

          "], + referenceId: "1", + position: "after", + }); + + executor.executeOne({ + // @ts-expect-error + type: "update", + blocks: ["

          test

          "], + referenceId: "1", + position: "after", + }); + + executor.executeOne({ + type: "add", + // @ts-expect-error + blocks: [{ type: "paragraph", content: "test" }], + referenceId: "1", + position: "after", + }); + }); +}); From e75bed16a24098e7fe0f389f783f4983c58bdc92 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 23 Sep 2025 10:31:20 +0200 Subject: [PATCH 49/68] fix build --- packages/xl-ai/src/api/aiRequest/execute.ts | 2 +- .../src/api/formats/html-blocks/htmlBlocks.ts | 12 +++--- packages/xl-ai/src/api/formats/json/json.ts | 35 +++++----------- .../formats/markdown-blocks/markdownBlocks.ts | 41 +++++-------------- .../vercelAiSdk/util/chatHandlers.ts | 2 +- packages/xl-ai/src/types.ts | 2 +- 6 files changed, 29 insertions(+), 65 deletions(-) diff --git a/packages/xl-ai/src/api/aiRequest/execute.ts b/packages/xl-ai/src/api/aiRequest/execute.ts index 24f8a9d78d..e25c5cdf42 100644 --- a/packages/xl-ai/src/api/aiRequest/execute.ts +++ b/packages/xl-ai/src/api/aiRequest/execute.ts @@ -13,7 +13,7 @@ export function buildAIRequest(opts: { userPrompt: string; useSelection?: boolean; deleteEmptyCursorBlock?: boolean; - streamToolsProvider?: StreamToolsProvider; + streamToolsProvider?: StreamToolsProvider; onBlockUpdated?: (blockId: string) => void; }) { const { useSelection, deleteEmptyCursorBlock, streamToolsProvider } = { diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts index 106a633fc1..1f0be5f984 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts @@ -1,6 +1,11 @@ import { BlockNoteEditor } from "@blocknote/core"; import { StreamTool } from "../../../streamTool/streamTool.js"; +import { + StreamToolsConfig, + StreamToolsProvider, + StreamToolsResult, +} from "../index.js"; import { defaultHTMLPromptBuilder } from "./defaultHTMLPromptBuilder.js"; import { defaultHTMLPromptInputDataBuilder, @@ -9,13 +14,6 @@ import { } from "./htmlPromptData.js"; import { tools } from "./tools/index.js"; -// Import the tool call types -import { - StreamToolsConfig, - StreamToolsProvider, - StreamToolsResult, -} from "../index.js"; - function getStreamTools< T extends StreamToolsConfig = { add: true; update: true; delete: true }, >( diff --git a/packages/xl-ai/src/api/formats/json/json.ts b/packages/xl-ai/src/api/formats/json/json.ts index 033b23e855..93484b6815 100644 --- a/packages/xl-ai/src/api/formats/json/json.ts +++ b/packages/xl-ai/src/api/formats/json/json.ts @@ -10,28 +10,9 @@ import { tools } from "./tools/index.js"; // Import the tool call types import { StreamToolsProvider } from "../../index.js"; -import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; -import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; -import { DeleteBlockToolCall } from "../base-tools/delete.js"; import { defaultJSONPromptBuilder } from "./defaultJSONPromptBuilder.js"; -// Define the tool types -export type AddTool = StreamTool>; -export type UpdateTool = StreamTool>; -export type DeleteTool = StreamTool; - -// Create a conditional type that maps boolean flags to tool types -export type StreamToolsConfig = { - add?: boolean; - update?: boolean; - delete?: boolean; -}; - -export type StreamToolsResult = [ - ...(T extends { update: true } ? [UpdateTool] : []), - ...(T extends { add: true } ? [AddTool] : []), - ...(T extends { delete: true } ? [DeleteTool] : []), -]; +import { StreamToolsConfig, StreamToolsResult } from "../index.js"; function getStreamTools< T extends StreamToolsConfig = { add: true; update: true; delete: true }, @@ -46,7 +27,7 @@ function getStreamTools< } | boolean, onBlockUpdate?: (blockId: string) => void, -): StreamToolsResult { +): StreamToolsResult { if (typeof selectionInfo === "boolean") { const selection = selectionInfo ? editor.getSelectionCutBlocks() @@ -87,16 +68,18 @@ function getStreamTools< : []), ]; - return streamTools as StreamToolsResult; + return streamTools as StreamToolsResult; } export const jsonBlockLLMFormat = { /** * Function to get the stream tools that can apply JSON block updates to the editor */ - getStreamToolsProvider: ( - opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ): StreamToolsProvider => ({ + getStreamToolsProvider: < + T extends StreamToolsConfig = { add: true; update: true; delete: true }, + >( + opts: { withDelays?: boolean; defaultStreamTools?: T } = {}, + ): StreamToolsProvider => ({ getStreamTools: (editor, selectionInfo, onBlockUpdate) => { return getStreamTools( editor, @@ -108,6 +91,8 @@ export const jsonBlockLLMFormat = { }, }), + tools, + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts index de71f63172..389754a8d1 100644 --- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts +++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts @@ -9,29 +9,10 @@ import { tools } from "./tools/index.js"; // Import the tool call types import { StreamToolsProvider } from "../../index.js"; -import { AddBlocksToolCall } from "../base-tools/createAddBlocksTool.js"; -import { UpdateBlockToolCall } from "../base-tools/createUpdateBlockTool.js"; -import { DeleteBlockToolCall } from "../base-tools/delete.js"; import { defaultMarkdownPromptBuilder } from "./defaultMarkdownPromptBuilder.js"; import { defaultMarkdownPromptDataBuilder } from "./markdownPromptData.js"; -// Define the tool types -export type AddTool = StreamTool>; -export type UpdateTool = StreamTool>; -export type DeleteTool = StreamTool; - -// Create a conditional type that maps boolean flags to tool types -export type StreamToolsConfig = { - add?: boolean; - update?: boolean; - delete?: boolean; -}; - -export type StreamToolsResult = [ - ...(T extends { update: true } ? [UpdateTool] : []), - ...(T extends { add: true } ? [AddTool] : []), - ...(T extends { delete: true } ? [DeleteTool] : []), -]; +import { StreamToolsConfig, StreamToolsResult } from "../index.js"; function getStreamTools< T extends StreamToolsConfig = { add: true; update: true; delete: true }, @@ -46,7 +27,7 @@ function getStreamTools< } | boolean, onBlockUpdate?: (blockId: string) => void, -): StreamToolsResult { +): StreamToolsResult { if (typeof selectionInfo === "boolean") { const selection = selectionInfo ? editor.getSelectionCutBlocks() @@ -87,21 +68,19 @@ function getStreamTools< : []), ]; - return streamTools as StreamToolsResult; + return streamTools as StreamToolsResult; } export const markdownBlockLLMFormat = { /** * Function to get the stream tools that can apply Markdown block updates to the editor */ - getStreamToolsProvider: ( - opts: { withDelays?: boolean; defaultStreamTools?: StreamToolsConfig } = {}, - ): StreamToolsProvider => ({ - getStreamTools: ( - editor, - selectionInfo, - onBlockUpdate?: (blockId: string) => void, - ) => { + getStreamToolsProvider: < + T extends StreamToolsConfig = { add: true; update: true; delete: true }, + >( + opts: { withDelays?: boolean; defaultStreamTools?: T } = {}, + ): StreamToolsProvider => ({ + getStreamTools: (editor, selectionInfo, onBlockUpdate) => { return getStreamTools( editor, opts.withDelays ?? true, @@ -112,6 +91,8 @@ export const markdownBlockLLMFormat = { }, }), + tools, + /** * The default PromptBuilder that determines how a userPrompt is converted to an array of * LLM Messages (CoreMessage[]) diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 8ade313616..be49e7ddff 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -227,7 +227,7 @@ export async function setupToolCallStreaming( // let all stream executors finish, this can take longer due to artificial delays // (e.g. to simulate human typing behaviour) - const result = (await Promise.allSettled([executor.close()]))[0]; + const result = (await Promise.allSettled([executor.finish()]))[0]; if (result.status === "rejected" && !erroredChunk) { throw new Error( diff --git a/packages/xl-ai/src/types.ts b/packages/xl-ai/src/types.ts index e8856ea5c2..0f3cf51f3a 100644 --- a/packages/xl-ai/src/types.ts +++ b/packages/xl-ai/src/types.ts @@ -22,7 +22,7 @@ export type LLMRequestHelpers = { /** * Customize which stream tools are available to the LLM */ - streamToolsProvider?: StreamToolsProvider; + streamToolsProvider?: StreamToolsProvider; /** * Extra options (header, body, metadata) that can be passed to LLM requests From 08dbb348f144f336a8a97c6ef6c424e14e4b13d6 Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 23 Sep 2025 11:18:40 +0200 Subject: [PATCH 50/68] cleanup --- .../util/UIMessageStreamToOperationsResult.ts | 22 +- .../vercelAiSdk/util/chatHandlers.ts | 282 +++++++++--------- .../util/partialObjectStreamUtil.ts | 79 +---- 3 files changed, 157 insertions(+), 226 deletions(-) diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts index 012303098f..5995265190 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts @@ -1,4 +1,4 @@ -import { DeepPartial, UIMessageChunk } from "ai"; +import { DeepPartial } from "ai"; import { createAsyncIterableStream, createAsyncIterableStreamFromAsyncIterable, @@ -6,10 +6,6 @@ import { import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations.js"; import { preprocessOperationsStreaming } from "../../preprocess.js"; import { StreamTool, StreamToolCall } from "../../streamTool.js"; -import { - textStreamToPartialObjectStream, - uiMessageStreamObjectDataToTextStream, -} from "./partialObjectStreamUtil.js"; import { AsyncIterableStream } from "../../../util/stream.js"; @@ -37,22 +33,6 @@ type OperationsResult[]> = AsyncIterableStream<{ metadata: any; }>; -// stream vs generate, responsibility of backend -// text vs object, - -export function UIMessageStreamToOperationsResult[]>( - stream: ReadableStream, - streamTools: T, - chunkMetadata: any, -): OperationsResult { - const ret = uiMessageStreamObjectDataToTextStream(stream).pipeThrough( - textStreamToPartialObjectStream<{ operations: StreamToolCall[] }>(), - ); - - // Note: we can probably clean this up by switching to streams instead of async iterables - return objectStreamToOperationsResult(ret, streamTools, chunkMetadata); -} - export function objectStreamToOperationsResult[]>( stream: ReadableStream[] }>>, streamTools: T, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index be49e7ddff..3dfd1ea4ed 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -8,6 +8,155 @@ import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsRes // TODO: comment file + design decisions // TODO: add notice about single executor (with downside that maybe streamtools must be changeable?) +/** + * Listens to messages received in the `chat` object and processes tool calls + * by streaming them to an executor + * + * It also listens to the status and error events of the chat object and handles them + * appropriately. + * + * It also waits for all tool calls to be completed and then adds the results to the chat object. + * + * NOTE: listening to the `chat` object is a bit cumbersome. It might have been + * cleaner to directly listen to the UIMessageStream. However, for that we'd probably + * need to wrap the transport or chat object in AIExtension + * + */ +export async function setupToolCallStreaming( + streamTools: StreamTool[], + chat: Chat, + onStart?: () => void, +) { + let erroredChunk: any | undefined; + + /* + We use a single executor even for multiple tool calls. + This is because a tool call operation (like Add), might behave differently + if a block has been added earlier (i.e.: executing tools can keep state, + and this state is shared across parallel tool calls). + */ + const executor = new StreamToolExecutor(streamTools, (chunk, success) => { + if (!success) { + erroredChunk = chunk; + } + }); + + const appendableStream = createAppendableStream(); + + appendableStream.output.pipeTo(executor.writable); + + const toolCallStreams = new Map(); + + let first = true; + + const unsub = chat["~registerMessagesCallback"](() => { + processToolCallParts(chat, (data) => { + if (!toolCallStreams.has(data.toolCallId)) { + const toolCallStreamData = createToolCallStream( + streamTools, + data.toolName, + data.toolCallId, + ); + appendableStream.append(toolCallStreamData.operationsStream); + toolCallStreams.set(data.toolCallId, toolCallStreamData); + if (first) { + first = false; + onStart?.(); + } + } + return toolCallStreams.get(data.toolCallId)!; + }); + }); + + const statusHandler = new Promise((resolve) => { + const unsub2 = chat["~registerStatusCallback"](() => { + if (chat.status === "ready" || chat.status === "error") { + unsub(); + unsub2(); + if (chat.status !== "error") { + // don't unsubscribe the error listener if chat.status === "error" + // we need to wait for the error event, because only in the error event we can read chat.error + // (in this status listener, it's still undefined) + unsub3(); + } + resolve(); + } + }); + + const unsub3 = chat["~registerErrorCallback"](() => { + if (chat.error) { + unsub3(); + for (const data of toolCallStreams.values()) { + if (!data.complete) { + data.writer.abort(chat.error); + } + } + // reject(chat.error); + // we intentionally commented out the above line to not reject here + // instead, we abort (raise an error) in the unfinished tool calls + } + }); + }); + + // wait until all messages have been received + // (possible improvement(?): we can abort the request if any of the tool calls fail + // instead of waiting for the entire llm response) + await statusHandler; + + // we're not going to append any more streams from tool calls, because we've seen all tool calls + await appendableStream.finalize(); + + // let all stream executors finish, this can take longer due to artificial delays + // (e.g. to simulate human typing behaviour) + const result = (await Promise.allSettled([executor.finish()]))[0]; + + if (result.status === "rejected" && !erroredChunk) { + throw new Error( + "Unexpected: executor.waitTillEnd() rejected but no erroredChunk", + { cause: result.reason }, + ); + } + + let errorSeen = false; + // process results + const toolCalls = Array.from(toolCallStreams.values()); + toolCalls.forEach((toolCall, index) => { + const isErrorTool = + toolCall.toolCallId === erroredChunk?.metadata.toolCallId; + let error: string | undefined; + if (isErrorTool) { + if (result.status === "fulfilled") { + throw new Error( + "Unexpected: executor.waitTillEnd() fulfilled but erroredChunk", + { cause: erroredChunk }, + ); + } + error = getErrorMessage(result.reason); + errorSeen = true; + } + + chat.addToolResult({ + tool: toolCalls[index].toolName, + toolCallId: toolCalls[index].toolCallId, + output: + errorSeen === false + ? { status: "ok" } + : isErrorTool + ? { status: "error", error } + : { status: "not-executed-previous-tool-errored" }, + }); + }); + + if (result.status === "rejected") { + throw result.reason; + } + + if (chat.error) { + // response failed + throw chat.error; + } +} + function createAppendableStream() { let controller: ReadableStreamDefaultController; let ready = Promise.resolve(); @@ -142,136 +291,3 @@ function processToolCallPart(part: any, toolCallData: ToolCallStreamData) { } } } - -/** - * Set up tool call streaming infrastructure with individual streams per toolCallId - * and merged results processing - */ -export async function setupToolCallStreaming( - streamTools: StreamTool[], - chat: Chat, - onStart?: () => void, -) { - let erroredChunk: any | undefined; - - const executor = new StreamToolExecutor(streamTools, (chunk, success) => { - if (!success) { - erroredChunk = chunk; - } - }); - - const appendableStream = createAppendableStream(); - - appendableStream.output.pipeTo(executor.writable); - - const toolCallStreams = new Map(); - - let first = true; - - const unsub = chat["~registerMessagesCallback"](() => { - processToolCallParts(chat, (data) => { - if (!toolCallStreams.has(data.toolCallId)) { - const toolCallStreamData = createToolCallStream( - streamTools, - data.toolName, - data.toolCallId, - ); - appendableStream.append(toolCallStreamData.operationsStream); - toolCallStreams.set(data.toolCallId, toolCallStreamData); - if (first) { - first = false; - onStart?.(); - } - } - return toolCallStreams.get(data.toolCallId)!; - }); - }); - - const statusHandler = new Promise((resolve) => { - const unsub2 = chat["~registerStatusCallback"](() => { - if (chat.status === "ready" || chat.status === "error") { - unsub(); - unsub2(); - if (chat.status !== "error") { - // don't unsubscribe the error listener if chat.status === "error" - // we need to wait for the error event, because only in the error event we can read chat.error - // (in this status listener, it's still undefined) - unsub3(); - } - resolve(); - } - }); - - const unsub3 = chat["~registerErrorCallback"](() => { - if (chat.error) { - unsub3(); - for (const data of toolCallStreams.values()) { - if (!data.complete) { - data.writer.abort(chat.error); - } - } - // reject(chat.error); - // we intentionally commented out the above line to not reject here - // instead, we abort (raise an error) in the unfinished tool calls - } - }); - }); - - // wait until all messages have been received - // (possible improvement(?): we can abort the request if any of the tool calls fail - // instead of waiting for the entire llm response) - await statusHandler; - - // we're not going to append any more streams from tool calls, because we've seen all tool calls - await appendableStream.finalize(); - - // let all stream executors finish, this can take longer due to artificial delays - // (e.g. to simulate human typing behaviour) - const result = (await Promise.allSettled([executor.finish()]))[0]; - - if (result.status === "rejected" && !erroredChunk) { - throw new Error( - "Unexpected: executor.waitTillEnd() rejected but no erroredChunk", - { cause: result.reason }, - ); - } - - let errorSeen = false; - // process results - const toolCalls = Array.from(toolCallStreams.values()); - toolCalls.forEach((toolCall, index) => { - const isErrorTool = - toolCall.toolCallId === erroredChunk?.metadata.toolCallId; - let error: string | undefined; - if (isErrorTool) { - if (result.status === "fulfilled") { - throw new Error( - "Unexpected: executor.waitTillEnd() fulfilled but erroredChunk", - { cause: erroredChunk }, - ); - } - error = getErrorMessage(result.reason); - errorSeen = true; - } - - chat.addToolResult({ - tool: toolCalls[index].toolName, - toolCallId: toolCalls[index].toolCallId, - output: - errorSeen === false - ? { status: "ok" } - : isErrorTool - ? { status: "error", error } - : { status: "not-executed-previous-tool-errored" }, - }); - }); - - if (result.status === "rejected") { - throw result.reason; - } - - if (chat.error) { - // response failed - throw chat.error; - } -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts index bb408368bb..2936999cde 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/partialObjectStreamUtil.ts @@ -1,87 +1,22 @@ import { getErrorMessage } from "@ai-sdk/provider-utils"; -import { - DeepPartial, - isDeepEqualData, - ObjectStreamPart, - parsePartialJson, - readUIMessageStream, - UIMessageChunk, -} from "ai"; +import { ObjectStreamPart, UIMessageChunk } from "ai"; /** * This file contains some helper functions to convert between object generation (streaming and non-streaming) * and UI Message streams and vice versa. * + * We convert object streams / generated objects to tool calls in UIMessageStreams because: + * + * - it simplifies our codebase (we can just handle everything as tool calls after conversion) + * - there are some issues with using a TextStream, see below: + * * Normally, the AI SDK uses a TextStream to transport generated objects / object streams. - * However, this does not work well with error handling (TODO: validate this). + * However, this does not work well with error handling * * See: * * @see https://github.com/vercel/ai/issues/5027#issuecomment-2701011869 * @see https://github.com/vercel/ai/issues/5115 - * - * Therefor, we convert the object (streams) to the UIMessageStream format that's also used by streamText / generateText - */ - -/** - * FUNCTIONS TO CONVERT FROM UIMESSAGESTREAM TO OBJECT (STREAMS)) - */ - -// based on https://github.com/vercel/ai/blob/d8ada0eb81e42633172d739a40c88e6c5a2f426b/packages/react/src/use-object.ts#L202 -export function textStreamToPartialObjectStream() { - let accumulatedText = ""; - let latestObject: DeepPartial | undefined = undefined; - return new TransformStream>({ - transform: async (chunk, controller) => { - accumulatedText += chunk; - const { value } = await parsePartialJson(accumulatedText); - - const currentObject = value as DeepPartial | undefined; - - if ( - currentObject !== undefined && - !isDeepEqualData(latestObject, currentObject) - ) { - latestObject = currentObject; - - controller.enqueue(currentObject); - } - }, - }); -} - -export function uiMessageStreamObjectDataToTextStream( - stream: ReadableStream, -) { - let errored = false; - const textStream = new ReadableStream({ - async start(controller) { - for await (const chunk of readUIMessageStream({ - stream, - onError: (error: any) => { - errored = true; - controller.error(error); - }, - terminateOnError: true, - })) { - for (const part of chunk.parts) { - switch (part.type) { - case "data-object-delta": - controller.enqueue(part.data); - break; - } - } - } - if (!errored) { - controller.close(); - } - }, - }); - return textStream; -} - -/** - * FUNCTIONS TO CONVERT FROM OBJECT (STREAMS) TO UIMESSAGESTREAM */ /** From b18edec01cd88acbe517c29b82e0ac8e4f40e40b Mon Sep 17 00:00:00 2001 From: yousefed Date: Tue, 23 Sep 2025 11:38:28 +0200 Subject: [PATCH 51/68] force toolchoice --- packages/xl-ai-server/src/routes/vercelAiSdk.ts | 1 + packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts | 1 + .../src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts index bb4ef99a73..6ed22ad0da 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdk.ts @@ -51,6 +51,7 @@ vercelAiSdkRoute.post("/streamText", async (c) => { outputSchema: jsonSchema({ type: "object" }), }), }, + toolChoice: "required", }); return result.toUIMessageStreamResponse(); diff --git a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts index 28cdf5c613..20fae55edd 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts +++ b/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts @@ -100,6 +100,7 @@ vercelAiSdkPersistenceRoute.post("/streamText", async (c) => { model, messages: convertToModelMessages(validatedMessages), tools, + toolChoice: "required", }); return result.toUIMessageStreamResponse({ diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 2310bcca0e..a38a409af0 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -185,6 +185,7 @@ export class ClientSideTransport inputSchema: jsonSchema(streamToolJSONSchema), }), }, + toolChoice: "required", // extra options for streamObject ...((_additionalOptions ?? {}) as any), // activeTools: ["applyDocumentOperations"], From 15e430f54bda70c301ec6f5c19857112d9af6e65 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 24 Sep 2025 02:38:06 +0200 Subject: [PATCH 52/68] notes --- packages/xl-ai/docs.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/xl-ai/docs.md diff --git a/packages/xl-ai/docs.md b/packages/xl-ai/docs.md new file mode 100644 index 0000000000..b1bb3f8166 --- /dev/null +++ b/packages/xl-ai/docs.md @@ -0,0 +1,13 @@ +backend integration + +- default (nextjs) + +implement protocol: + +- https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#data-stream-protocol +- https://github.com/vercel/ai/issues/7496#issuecomment-3181826620 + +ClientSideTransport + +- connect directly to backend +- proxy From 9a7f473db096b2ee888c3d7f4d89268def6bf1b7 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 24 Sep 2025 07:02:18 +0200 Subject: [PATCH 53/68] small fixes --- .../src/streamTool/StreamToolExecutor.ts | 14 +++- packages/xl-ai/src/streamTool/asTool.ts | 44 ----------- .../clientside/ClientSideTransport.ts | 76 +++++++------------ 3 files changed, 40 insertions(+), 94 deletions(-) delete mode 100644 packages/xl-ai/src/streamTool/asTool.ts diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index 850cb47b31..4afe2b3563 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -1,3 +1,4 @@ +import { getErrorMessage } from "@ai-sdk/provider-utils"; import { parsePartialJson } from "ai"; import { StreamTool, StreamToolCall } from "./streamTool.js"; @@ -129,12 +130,21 @@ export class StreamToolExecutor[]> { break; } } catch (error) { + // TODO: remove? onChunkComplete?.(chunk, false, error); - throw new Error("error bla"); + throw new Error( + `Tool execution failed: ${getErrorMessage(error)}`, + { + cause: error, + }, + ); } } if (!handled) { - throw new Error("unhandled chunk"); + const operationType = (chunk.operation as any)?.type || "unknown"; + throw new Error( + `No tool could handle operation of type: ${operationType}`, + ); } }, }); diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts deleted file mode 100644 index a1adc32528..0000000000 --- a/packages/xl-ai/src/streamTool/asTool.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { jsonSchema, tool } from "ai"; -import { createStreamToolsArraySchema } from "./jsonSchema.js"; -import { StreamTool } from "./streamTool.js"; - -// TODO: remove or implement - -export function streamToolAsTool>(streamTool: T) { - return tool({ - inputSchema: jsonSchema(streamTool.inputSchema, { - validate: (value) => { - const result = streamTool.validate(value); - if (!result.ok) { - return { success: false, error: new Error(result.error) }; - } - return { success: true, value: result.value }; - }, - }), - // execute: async (_value) => { - // // console.log("execute", value); - // // TODO - // }, - }); -} - -export function streamToolsAsTool[]>(streamTools: T) { - const schema = createStreamToolsArraySchema(streamTools); - - return tool({ - name: "applyDocumentOperations", - inputSchema: jsonSchema(schema, { - // validate: (value) => { - // const stream = operationsToStream(value); - // if (!stream.ok) { - // return { success: false, error: new Error(stream.error) }; - // } - // return { success: true, value: stream.value }; - // }, - }), - // execute: async (_value) => { - // // TODO - // // console.log("execute", value); - // }, - }); -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index a38a409af0..6dd00db1b7 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -16,6 +16,28 @@ import { partialObjectStreamAsToolCallInUIMessageStream, } from "../util/partialObjectStreamUtil.js"; +export const PROVIDER_OVERRIDES = { + "mistral.chat": { + mode: "auto" as const, + }, + "google.generative-ai": { + mode: "auto" as const, + }, + "groq.chat": { + providerOptions: { + groq: { + structuredOutputs: false, + }, + }, + }, +} as const; + +export function getProviderOverrides(model: Exclude) { + return ( + PROVIDER_OVERRIDES[model.provider as keyof typeof PROVIDER_OVERRIDES] || {} + ); +} + export class ClientSideTransport implements ChatTransport { @@ -77,40 +99,19 @@ export class ClientSideTransport const schema = jsonSchema(streamToolJSONSchema); const ret = await generateObject({ - // non-overridable options for streamObject output: "object" as const, schema, model, - // configurable options for streamObject - - // - optional, with defaults - - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - model.provider === "mistral.chat" || - model.provider === "google.generative-ai" - ? "auto" - : "tool", + mode: "tool", messages: convertToModelMessages(messages), - providerOptions: - model.provider === "groq.chat" - ? { - groq: { - structuredOutputs: false, - }, - } - : {}, - // extra options for streamObject + ...getProviderOverrides(model), ...((_additionalOptions ?? {}) as any), }); return objectAsToolCallInUIMessageStream( ret.object, "applyDocumentOperations", - ); // TODO, better not hardcode + ); } /** @@ -131,40 +132,19 @@ export class ClientSideTransport const schema = jsonSchema(streamToolJSONSchema); const ret = streamObject({ - // non-overridable options for streamObject output: "object" as const, schema, model, - // configurable options for streamObject - - // - optional, with defaults - // mistral somehow needs "auto", while groq/llama needs "tool" - // google needs "auto" because https://github.com/vercel/ai/issues/6959 - // TODO: further research this and / or make configurable - // for now stick to "tool" by default as this has been tested mostly - mode: - model.provider === "mistral.chat" || - model.provider === "google.generative-ai" - ? "auto" - : "tool", - // - mandatory ones: + mode: "tool", messages: convertToModelMessages(messages), - providerOptions: - model.provider === "groq.chat" - ? { - groq: { - structuredOutputs: false, - }, - } - : {}, - // extra options for streamObject + ...getProviderOverrides(model), ...((_additionalOptions ?? {}) as any), }); // Transform the partial object stream to a data stream format return partialObjectStreamAsToolCallInUIMessageStream( ret.fullStream, - "applyDocumentOperations", // TODO, better not hardcode + "applyDocumentOperations", ); } From 53acd170f02a6a8dec58ff1f06a1f55cdefab152 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 24 Sep 2025 11:43:06 +0200 Subject: [PATCH 54/68] fix error handling --- .../formats/base-tools/createAddBlocksTool.ts | 2 +- .../src/streamTool/StreamToolExecutor.ts | 27 +++--- .../vercelAiSdk/util/chatHandlers.ts | 88 +++++++++++-------- 3 files changed, 67 insertions(+), 50 deletions(-) diff --git a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts index 1dd8ac7b9b..8f6cc0f421 100644 --- a/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts +++ b/packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts @@ -192,7 +192,7 @@ export function createAddBlocksTool(config: { // pass through non-add operations return false; } - // throw new Error("test error"); + const operation = chunk.operation as AddBlocksToolCall; const jsonToolCall = await config.toJSONToolCall(editor, { diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts index 4afe2b3563..83263cc139 100644 --- a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts +++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts @@ -2,6 +2,17 @@ import { getErrorMessage } from "@ai-sdk/provider-utils"; import { parsePartialJson } from "ai"; import { StreamTool, StreamToolCall } from "./streamTool.js"; +export class ChunkExecutionError extends Error { + constructor( + message: string, + public readonly chunk: any, + options?: { cause?: unknown }, + ) { + super(message, options); + this.name = "ChunkExecutionError"; + } +} + /** * The Operation types wraps a StreamToolCall with metadata on whether * it's an update to an existing and / or or a possibly partial (i.e.: incomplete, streaming in progress) operation @@ -51,15 +62,7 @@ export class StreamToolExecutor[]> { /** * @param streamTools - The StreamTools to use to apply the StreamToolCalls */ - constructor( - private streamTools: T, - // TODO: use this? - private readonly onChunkComplete?: ( - chunk: Operation, - success: boolean, - error?: any, - ) => void, - ) { + constructor(private streamTools: T) { this.stream = this.createStream(); } @@ -113,7 +116,6 @@ export class StreamToolExecutor[]> { private createExecutor() { const executors = this.streamTools.map((tool) => tool.executor()); - const onChunkComplete = this.onChunkComplete; return new TransformStream< Operation, @@ -130,10 +132,9 @@ export class StreamToolExecutor[]> { break; } } catch (error) { - // TODO: remove? - onChunkComplete?.(chunk, false, error); - throw new Error( + throw new ChunkExecutionError( `Tool execution failed: ${getErrorMessage(error)}`, + chunk, { cause: error, }, diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index 3dfd1ea4ed..cfdb3f2704 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -2,12 +2,12 @@ import { getErrorMessage } from "@ai-sdk/provider-utils"; import { Chat } from "@ai-sdk/react"; import { DeepPartial, isToolUIPart, UIMessage } from "ai"; import { StreamTool, StreamToolCall } from "../../streamTool.js"; -import { StreamToolExecutor } from "../../StreamToolExecutor.js"; +import { + ChunkExecutionError, + StreamToolExecutor, +} from "../../StreamToolExecutor.js"; import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsResult.js"; -// TODO: comment file + design decisions -// TODO: add notice about single executor (with downside that maybe streamtools must be changeable?) - /** * Listens to messages received in the `chat` object and processes tool calls * by streaming them to an executor @@ -17,29 +17,28 @@ import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsRes * * It also waits for all tool calls to be completed and then adds the results to the chat object. * - * NOTE: listening to the `chat` object is a bit cumbersome. It might have been + * NOTE: listening to the `chat` object + error handling is a bit cumbersome. It might have been * cleaner to directly listen to the UIMessageStream. However, for that we'd probably * need to wrap the transport or chat object in AIExtension * + * The error handling is currently quite convoluted. To properly test this, + * you can: + * a) make sure a tool call fails + * b) make sure the entire request fails (network error) + * */ export async function setupToolCallStreaming( streamTools: StreamTool[], chat: Chat, onStart?: () => void, ) { - let erroredChunk: any | undefined; - /* We use a single executor even for multiple tool calls. This is because a tool call operation (like Add), might behave differently if a block has been added earlier (i.e.: executing tools can keep state, and this state is shared across parallel tool calls). */ - const executor = new StreamToolExecutor(streamTools, (chunk, success) => { - if (!success) { - erroredChunk = chunk; - } - }); + const executor = new StreamToolExecutor(streamTools); const appendableStream = createAppendableStream(); @@ -88,6 +87,7 @@ export async function setupToolCallStreaming( unsub3(); for (const data of toolCallStreams.values()) { if (!data.complete) { + // this can happen in case of a network error for example data.writer.abort(chat.error); } } @@ -105,33 +105,33 @@ export async function setupToolCallStreaming( // we're not going to append any more streams from tool calls, because we've seen all tool calls await appendableStream.finalize(); - // let all stream executors finish, this can take longer due to artificial delays // (e.g. to simulate human typing behaviour) const result = (await Promise.allSettled([executor.finish()]))[0]; - if (result.status === "rejected" && !erroredChunk) { - throw new Error( - "Unexpected: executor.waitTillEnd() rejected but no erroredChunk", - { cause: result.reason }, - ); + let error: ChunkExecutionError | undefined; + if (result.status === "rejected") { + if (result.reason instanceof ChunkExecutionError) { + error = result.reason; + } else { + if (!chat.error) { + throw new Error( + "Unexpected: no ChunkExecutionError but also no chat.error (network error?)", + ); + } + } } let errorSeen = false; // process results - const toolCalls = Array.from(toolCallStreams.values()); + const toolCalls = Array.from( + toolCallStreams.values().filter((data) => data.complete), + ); toolCalls.forEach((toolCall, index) => { const isErrorTool = - toolCall.toolCallId === erroredChunk?.metadata.toolCallId; - let error: string | undefined; + toolCall.toolCallId === error?.chunk.metadata.toolCallId; + if (isErrorTool) { - if (result.status === "fulfilled") { - throw new Error( - "Unexpected: executor.waitTillEnd() fulfilled but erroredChunk", - { cause: erroredChunk }, - ); - } - error = getErrorMessage(result.reason); errorSeen = true; } @@ -142,13 +142,13 @@ export async function setupToolCallStreaming( errorSeen === false ? { status: "ok" } : isErrorTool - ? { status: "error", error } + ? { status: "error", error: getErrorMessage(error) } : { status: "not-executed-previous-tool-errored" }, }); }); - if (result.status === "rejected") { - throw result.reason; + if (error) { + throw error; } if (chat.error) { @@ -160,25 +160,38 @@ export async function setupToolCallStreaming( function createAppendableStream() { let controller: ReadableStreamDefaultController; let ready = Promise.resolve(); - + let canceled = false; const output = new ReadableStream({ start(c) { controller = c; }, + cancel(reason) { + canceled = true; + controller.error(reason); + }, }); async function append(readable: ReadableStream) { + if (canceled) { + throw new Error("Appendable stream canceled, can't append"); + } const reader = readable.getReader(); // Chain appends in sequence ready = ready.then(async () => { // eslint-disable-next-line no-constant-condition while (true) { - const { done, value } = await reader.read(); - if (done) { + try { + const { done, value } = await reader.read(); + if (done || canceled) { + break; + } + controller.enqueue(value); + } catch (e) { + canceled = true; + controller.error(e); break; } - controller.enqueue(value); } }); @@ -187,7 +200,10 @@ function createAppendableStream() { async function finalize() { await ready; // wait for last appended stream to finish - controller.close(); // only close once no more streams will come + + if (!canceled) { + controller.close(); // only close once no more streams will come + } } return { output, append, finalize }; From c5a1cac0eeb0cb0a2d9db747e1fd29424fdb8b67 Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 24 Sep 2025 19:16:11 +0200 Subject: [PATCH 55/68] add comment --- .../xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts index cfdb3f2704..e39530d8d9 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts @@ -48,6 +48,11 @@ export async function setupToolCallStreaming( let first = true; + // Possible improvement: instead of pushing tool call updates directly, + // we could make this a readablestream where we return the latest state + // of the tool call input. This way we don't process all intermediate + // streaming steps in case downstream consumer (like the StreamToolExecutor) + // are slower than the producer const unsub = chat["~registerMessagesCallback"](() => { processToolCallParts(chat, (data) => { if (!toolCallStreams.has(data.toolCallId)) { From f93d52fd2c46e49cd8fc25eb5cbbc1102e4478cc Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 25 Sep 2025 06:20:25 +0200 Subject: [PATCH 56/68] fix tests --- ...ck_1_96d0e1517a8bb553eb9b6ee21982497a.json | 15 +++++++++ ...ck_1_d609d910fa35913532281cbe974c5f07.json | 15 --------- ...d)_1_c3577a8e8564c8deb1c89af291d8b2a0.json | 15 --------- ...d)_1_d2f73226dddd06ac91dea952e1a9ee81.json | 15 +++++++++ ...c)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json | 15 +++++++++ ...c)_1_90633e6f6455774f126fcf81b6dd9a24.json | 15 --------- ...d)_1_796e6ec366f12b12cee29e254e861248.json | 15 --------- ...d)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json | 15 +++++++++ ...)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json} | 4 +-- ...k_1_5d9c47c4909388aa5eb834e520036903.json} | 4 +-- ...)_1_338994884cfc874503546888764609a0.json} | 4 +-- ...)_1_2115dc6928012212f947319925cc0ac9.json} | 4 +-- ...)_1_23dd862dafcd7507928655ff9d663c49.json} | 4 +-- ...)_1_95680ca6feb571de6a8f6acfdb77b183.json} | 4 +-- ...ck_1_5cb5969256536cfe3360d4c6142e580c.json | 2 +- ...d)_1_cf519dc42b5d5ab96892746983e054f5.json | 2 +- ...c)_1_ee1fc8c443fc731bcf2b941528a18d91.json | 2 +- ...d)_1_bdae0c6bc0379d3a2b9ca48556974339.json | 2 +- ...t)_1_c2cedd1c149bff876a53867177c0583e.json | 2 +- ...ck_1_0523740bd337e9bda9dfe06f8d02e4be.json | 15 +++++++++ ...ck_1_d992c1b0be938939bcc2da485962c78b.json | 15 --------- ...d)_1_31cf7da48755c7f8f58270eef4fefcdf.json | 15 +++++++++ ...d)_1_e6f70767b9e3370015490920e244c4aa.json | 15 --------- ...c)_1_515fc265090a97b5957d74b469c33b46.json | 15 +++++++++ ...c)_1_64d30b1e7e1ef3d253c7a06fddde6889.json | 15 --------- ...d)_1_869075fdc1903bdcff077c9815e352cf.json | 15 --------- ...d)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json | 15 +++++++++ ...t)_1_6207085019334e4a371c8adaacb140af.json | 15 --------- ...t)_1_c2b667d1ebaad426133a8964247d929a.json | 15 +++++++++ ...ph_1_b818317df42c5cb1679f63409bfb31a7.json | 15 --------- ...ph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json | 15 +++++++++ ...on_1_8b91d2f21694112af7f45ddd4338bde2.json | 15 --------- ...on_1_ae989a416fa1cb51342f1da4c5bbe105.json | 15 +++++++++ ...h_1_378d0283669b8b42c263e6465eed1050.json} | 4 +-- ...n_1_cb62f56bbbb5b00e359df80a7d87023a.json} | 4 +-- ...ph_1_d83ed705634e892e8905fadc0f4c5d0b.json | 2 +- ...on_1_c6fb82e817b9dad69fb7d7369cac5784.json | 2 +- ...ph_1_8924f215c9d7466b6192b5a44fe35208.json | 15 +++++++++ ...ph_1_e0e573f126f8dcfc1d1da436a1631ac1.json | 15 --------- ...on_1_09dc8802102a3872a1bea73e45c076e7.json | 15 +++++++++ ...on_1_796d3b3fb3726692a8631a770864f39e.json | 15 --------- ...k_1_6a0dfd684aecfb69ca21f75edcd902ab.json} | 4 +-- ...k_1_7b22f1ffbbb14c43846e389319cf5f52.json} | 4 +-- ...ck_1_229a12c5bb3aad2c166d03b0409d2958.json | 2 +- ...ck_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json | 15 +++++++++ ...ck_1_c69b87b4051b3dd8570a549150b9f62b.json | 15 --------- ...ng_1_77f51f99b9f3e4293594aa197dee7ff7.json | 15 +++++++++ ...k_1_0f53bf27715200b28572c62747c24484.json} | 4 +-- ...k_1_7616ac20399dcfe20716ebb9fb26f4a6.json} | 4 +-- ...t_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json} | 4 +-- ...t_1_27fdad5a71c2b13b91130184d66a69aa.json} | 4 +-- ...on_1_7d062c80ac3907dba56f52908361d3c1.json | 15 +++++++++ ...on_1_aa486140c2ee9c9c151278673ef5b534.json | 15 --------- ...e_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json} | 4 +-- ...rk_1_1990cfafdbe6915cc301ba24ba6477c3.json | 15 +++++++++ ...rk_1_67b1aea5b2196920674bb67095939ff4.json | 15 --------- ...on_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json | 15 --------- ...on_1_d3744e6f58b758ff270777a78212936f.json | 15 +++++++++ ...t_1_de47b8292e8d513efd1668566ad729cb.json} | 4 +-- ...op_1_7557f4e0b1168c9cfa85cc2949d3483e.json | 15 +++++++++ ...op_1_e2b88b585725be6ca65dcd553149b637.json | 15 --------- ...xt_1_57abff3f1cf681ccc8006b74bf065746.json | 15 +++++++++ ...xt_1_673f1e8de9e7cb18c81176e9cc11a8ff.json | 15 --------- ...)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json} | 4 +-- ...d)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json | 15 +++++++++ ...d)_1_beec7f3c8352ec01b4006cca21cddecd.json | 15 --------- ...on_1_3e1e8046704f4c1272001e1f1002f592.json | 15 +++++++++ ...on_1_8c7f6291076f8d78549724e1e2176d07.json | 15 --------- ...st_1_8f32e048b79fef7ba196203c0790ac1f.json | 15 +++++++++ ...st_1_e71b1d8d60f3f48fbf4965b5050098bd.json | 15 --------- ...nt_1_2281ea1801f2a209eee53f1a861410c2.json | 15 +++++++++ ...op_1_9e2953494168bd54125bdfba22ba90f4.json | 15 +++++++++ ...t_1_d28bae3e96103e3163113d1ff73a4f54.json} | 4 +-- ...e_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json} | 4 +-- ...ng_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json | 15 +++++++++ ...k_1_cf6f0ea25e679a2c084fc62111763c1f.json} | 4 +-- ...k_1_27ea0e2007440ced1773d35273014e75.json} | 4 +-- ...t_1_ba9a41e978e1758a1fb428c11d631624.json} | 4 +-- ...t_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json} | 4 +-- ...n_1_aa9cc3df7357c7df8c4aab4db25ef364.json} | 4 +-- ...e_1_786c4803ef13f91d0ee9d9d5ef7efd53.json} | 4 +-- ...k_1_1a4818ddc5602370cb091f26c8975028.json} | 4 +-- ...n_1_b01041740d43371bbdbb83b9df9b82d8.json} | 4 +-- ...t_1_78610509e4014344defb72c2362d3410.json} | 4 +-- ...p_1_56fcf64add84f7ad27f74ca4b26befc1.json} | 4 +-- ...t_1_7923c4dc04dcbcf37a3b53e86136bcf0.json} | 4 +-- ...)_1_29ac6f2077f9c4a913971e9de8992d64.json} | 4 +-- ...)_1_493fb526ec9f5849dd3fed6d4354b6a6.json} | 4 +-- ...n_1_db456b037057f990036a9dbe4c7f0119.json} | 4 +-- ...t_1_6aaa6ae6676b070495550b20a0e90b18.json} | 4 +-- ...nt_1_f90a6f351669841e970de61ba1f65964.json | 15 +++++++++ ...op_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json | 15 +++++++++ ...t_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json} | 4 +-- ...e_1_67b84d717ff0d339705097fd3776d332.json} | 4 +-- ...ng_1_e36e05c66a1610414db2b182e5838630.json | 15 +++++++++ ...rk_1_8924ab7942a31319ff0bed562dc978c7.json | 2 +- ...nk_1_bb22d361bb5e6f25a9ba5357553fd8f4.json | 2 +- ...nt_1_fce88de162f505469f329e0963496770.json | 2 +- ...nt_1_929f8d5bec1509c88a91cf9dcfa4707c.json | 2 +- ...on_1_e234ef5080ef199082d042c16b41cc2f.json | 2 +- ...te_1_80d1c8e8d1c2656834de79b388f2344a.json | 2 +- ...rk_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json | 2 +- ...on_1_d9c8e71bc14549ad598958ce78eb8523.json | 2 +- ...nt_1_20b6db0a713d475547adeee41f24da94.json | 2 +- ...op_1_94f0b12b9b22b4d4309401f9efc0a533.json | 2 +- ...xt_1_c6781e0373f28bb83c2fade34630129f.json | 2 +- ...h)_1_a8ad37dedc518e45cfc4606b5bec394e.json | 2 +- ...d)_1_49918221a90bc2d25a1288d33f718530.json | 2 +- ...on_1_6bec6487dfe642d6607cbac3e3567c9b.json | 2 +- ...st_1_195ecfa59c77a5af5b5ce68d4385de24.json | 2 +- ...nt_1_9beca226d02b25d743b53bc046843d40.json | 15 +++++++++ ...op_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json | 15 +++++++++ ...nt_1_559ac20931643831f47c84f41daab0bb.json | 2 +- ...pe_1_9b7c4f0d9b556cda64777fa2c9912299.json | 2 +- ...ng_1_184b822ea13903701153170335d38a3f.json | 15 +++++++++ ...rk_1_15550b742875ba5cbe9327ea1e5ca526.json | 15 +++++++++ ...rk_1_a5ab12392ecaea8f050e07b016f62dde.json | 15 --------- ...nk_1_4c67bcfcc395c016784e8d11840d041f.json | 15 +++++++++ ...nk_1_88714755dac24eb4dc53b3992c66a843.json | 15 --------- ...nt_1_ca97d41aec2616b40b0bc40893a79c89.json | 15 --------- ...nt_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json | 15 +++++++++ ...nt_1_25a7b376cf9a40be2786f79865156598.json | 15 +++++++++ ...nt_1_3d7ef09df29b651e82a55ccc7129f343.json | 15 --------- ...on_1_2ee4f417a0603cf9f340ca8b84a24be6.json | 15 --------- ...on_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json | 15 +++++++++ ...te_1_15387f9c27484f6bf8068f60174c14f6.json | 15 --------- ...te_1_c5f9c947bbd30bc61b89cc08d041cea5.json | 15 +++++++++ ...rk_1_0f777e7030958cba6d42fcaf488c438c.json | 15 --------- ...rk_1_f265b08529a3bb0962b033db42e40f5c.json | 15 +++++++++ ...on_1_1447b6b4a31a37fbbe03816c97c133f1.json | 15 +++++++++ ...on_1_1a8deecf4e81a3573383a52a8e6961b0.json | 15 --------- ...nt_1_8607b2c5692d759cd4b56dde8dd2668c.json | 15 +++++++++ ...nt_1_99203bad6675a8e8cc354ad0360f1750.json | 15 --------- ...op_1_90697ba401b8db0a68d54ab1a23672f1.json | 15 +++++++++ ...op_1_df20d773f1b621f01e595ac5d44c3e1b.json | 15 --------- ...xt_1_72da86021e579186b122b75d71128960.json | 15 --------- ...xt_1_f9baf6e1f21c2ff975bb8476164dfe3b.json | 15 +++++++++ ...h)_1_19ae8517bff1915931b5cde2d97220bb.json | 15 --------- ...h)_1_9b1d3a2188afa487f789dd156b22760d.json | 15 +++++++++ ...d)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json | 15 --------- ...d)_1_d14263cec9b6767d63f061c4dbd9b0f6.json | 15 +++++++++ ...on_1_3f7a20484d5ce0f53a05fba5810b307f.json | 15 +++++++++ ...on_1_ff5f616b85fb952da2097208ac01b6cf.json | 15 --------- ...st_1_1de6675c8dd76d0d991b35418f577bc0.json | 15 +++++++++ ...st_1_66322c56af18dc5c6b2e74db37e03fb4.json | 15 --------- ...nt_1_dd621803f2b7173fbc649dc1033c09d4.json | 15 +++++++++ ...op_1_ab0a01fa6be0c754feda7d55862b94a0.json | 15 +++++++++ ...nt_1_0a946efda0df9d65d49dfdd31a7ac9d0.json | 15 +++++++++ ...nt_1_7a047262ac7b92d2c5c967abff011b99.json | 15 --------- ...pe_1_3cd44dcefabfe1768eaf05804aaf9ba8.json | 15 +++++++++ ...pe_1_6fcee8488932f8a8d476c5712bf705f6.json | 15 --------- .../formats/html-blocks/htmlBlocks.test.ts | 33 ++++++++----------- 152 files changed, 875 insertions(+), 702 deletions(-) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json => add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json} (50%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json => Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a list (end)_1_f182421455591cc5dadcdba4e2287710.json => add a list (end)_1_338994884cfc874503546888764609a0.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json => add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json => add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json => add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json} (78%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json delete mode 100644 packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json create mode 100644 packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json => add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json => add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json} (76%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json create mode 100644 packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json delete mode 100644 packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json => delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json} (60%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json => delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json} (77%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json => drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json} (50%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json => drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json => modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{modify parent content_1_f0cc603dc9a00de30b559775758297ca.json => modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json} (51%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json => standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json} (53%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json => styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json} (52%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json => styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json} (51%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json => update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json} (50%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json => update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json} (56%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json => drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json => drop mark and link_1_27ea0e2007440ced1773d35273014e75.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{modify nested content_1_e902977c579036dbb160ae0eca395ae2.json => modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json => modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json => plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{standard update_1_303c0500fccb45f2eda1e4971926380e.json => standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json} (82%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json => styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json => styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json => styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json => styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json => styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json => styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json => styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json} (80%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{translate selection_1_1499e8407f779455394b30013d5582ae.json => translate selection_1_db456b037057f990036a9dbe4c7f0119.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json => turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json} (73%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json => update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json => update block type_1_67b84d717ff0d339705097fd3776d332.json} (79%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json new file mode 100644 index 0000000000..640b734a48 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_012Kb5amw4X7zt46ugsJ3uJH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NsF3dRrcByZis6tAf2gFgd\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erenceId\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"os\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ition\\\":\\\"af\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ter\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"blocks\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          Cod\"} }\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\":\"
          c\"}           }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"onsole.log('\"}  }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"hello world'\"}    }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");\\\"]}]}\"}            }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0     }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":123}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"     }\n\n",
          +    "headers": []
          +  }
          +}
          \ No newline at end of file
          diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json
          deleted file mode 100644
          index 6d1a1340e3..0000000000
          --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_d609d910fa35913532281cbe974c5f07.json	
          +++ /dev/null
          @@ -1,15 +0,0 @@
          -{
          -  "request": {
          -    "method": "POST",
          -    "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages",
          -    "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n        Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n        List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015BTLnGhPJTt3V9PYba2c6a\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1131,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a heading and a JavaScript code block\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" at the end of the \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"document. Since the cursor is between\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" blocks, and you want to add content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"at the end of doc\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll add the content after the last\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" block (which is \\\"How are you?\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01MytcKtGUwEZyxZuEHiRoyf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"add\\\",\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eferenc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"position\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"after\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"blocks\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":[\\\"

          Co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"de\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"
          c\"}   }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\"}        }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sole\"}            }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\".log('he\"}     }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo world'\"}       }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");
          \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1131,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":194} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json deleted file mode 100644 index 1e4272b255..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_c3577a8e8564c8deb1c89af291d8b2a0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01J2aYGPqbGiqroxyLBQWDSU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1117,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll add a list\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with the items 'Apples' an\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d 'Bananas' after the last sentence\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" in the document.\\n\\nLooking at the document,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last sentence is \\\"How\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you?\\\" which has the ID\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"ref2$\\\". I'll\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" add the list items right after this block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01C2zXZqLkoQJ1mBQFyMnTeU\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"refere\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nceId\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"fter\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"cks\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"
            Apples\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
          \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"
            Banana\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s
          \\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1117,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":197} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json new file mode 100644 index 0000000000..faaa99613d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
          • item1
          ` is valid, but `
          • item1
          • item2
          ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
          ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

          Hello, world!

          \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

          How are you?

          \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01WqEsawKYAnwnU3RiWMrWdz\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017ZX7PA7FFhbe8ZajRM3oe9\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"add\\\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erenceId\\\"\"}}\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\":\"$\\\",\\\"posit\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"fte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oc\"} }\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\":\"
          • Apples\\\",\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ul>
          • Ban\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"anas
          • \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":111} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json new file mode 100644 index 0000000000..a1f22bd985 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01VRzd5N6QHSxhM3prs4bfYL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01CVXVx3GaeZX2PXGiE94Biq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

            You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" loo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k great to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day!<\"} }\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\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":84} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json deleted file mode 100644 index 52891229b6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_90633e6f6455774f126fcf81b6dd9a24.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Vu2okK4c9HSrEVTMdq1HbW\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1080,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"'ll add a paragraph with the text '\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"You look great today!' to your document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nSince the document is currently empty (\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"with just an empty paragraph), I'll update\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" that empty paragraph with your text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QsKzZ1bj87dETchhwPJudH\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

            You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

            \\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1080,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":141} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json deleted file mode 100644 index 345b34a975..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_796e6ec366f12b12cee29e254e861248.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CDDtLqfzeeN5j4bdFtN9uy\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"'ll add a new paragraph with the\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" text \\\"You look great\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" today!\\\" after the last sentence in the document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nLooking at the document,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last sentence is \\\"How\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you?\\\" in the block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with id \\\"ref2$\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll add a new paragraph after this block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01KE2jD22EBrDiQtu4ziQYHz\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erence\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"po\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sition\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"after\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ks\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":[\\\"

            You \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oday!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":168} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json new file mode 100644 index 0000000000..5510b5c0ab --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CKWDzQ898wuCGhVoAr4M1q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01JbdwQRBCSbhGc1gDU47BJY\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"add\\\",\\\"refer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"enceId\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"aft\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ks\\\":[\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>You look \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json similarity index 50% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json index cd1dbc94af..26832e29f6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_61a1e8c60563c8cdcb6ce0eb5d208b5a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01DEbbq79ZSAEfyX2DpGyjqb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph with the text 'You look\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" great today!' before the first sentence in the \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"document.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017W8cfvFa9ojoRLt5n7Wjwr\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ferenceId\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\\\",\\\"pos\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ition\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"before\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ocks\\\":[\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"You look g\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1112,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":134} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01MXpAdMyy1JWMCBczY4wVGJ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016ZrbziXZhCBqSE32zuBEWW\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"referen\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ce\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"positi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\\\":\\\"before\\\"\"} }\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\":\"s\\\":\"} }\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\":\"You look gr\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eat tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!

            \\\"]}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json index 7896e32abb..c9e1f5e712 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_44b361a973e7aecbab9d27adfb8d78c9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm8n9ffq9j5q47s08yne2\"}}\n\ndata: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"p41eh3gjz\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"blocks\\\":[\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language='javascript'\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a3608a82-eb9e-49f2-9c66-cf69ab025138\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm8n9ffq9j5q47s08yne2\",\"usage\":{\"queue_time\":0.252781728,\"prompt_tokens\":829,\"prompt_time\":0.080379153,\"completion_tokens\":79,\"completion_time\":0.166194275,\"total_tokens\":908,\"total_time\":0.246573428}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvt2bedntfbaezj53j1e7\"}}\n\ndata: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b1m32skcm\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"blocks\\\":[\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvt2bedntfbaezj53j1e7\",\"usage\":{\"queue_time\":0.219656376,\"prompt_tokens\":845,\"prompt_time\":0.069583372,\"completion_tokens\":76,\"completion_time\":0.164241172,\"total_tokens\":921,\"total_time\":0.233824544}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json index da63a8479d..01e3d684b6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_f182421455591cc5dadcdba4e2287710.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}],\"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\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm870e10r85ahk7q2dbah\"}}\n\ndata: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xfs80gfyq\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-3f93aa95-53ea-44f1-be23-b75e14acf943\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm870e10r85ahk7q2dbah\",\"usage\":{\"queue_time\":0.198740233,\"prompt_tokens\":813,\"prompt_time\":0.069264736,\"completion_tokens\":57,\"completion_time\":0.120678635,\"total_tokens\":870,\"total_time\":0.189943371}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvsnkeb09661xhxp8444z\"}}\n\ndata: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cr84bwjnp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvsnkeb09661xhxp8444z\",\"usage\":{\"queue_time\":0.143981598,\"prompt_tokens\":829,\"prompt_time\":0.070478034,\"completion_tokens\":54,\"completion_time\":0.123841596,\"total_tokens\":883,\"total_time\":0.19431963}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json index 501121e2df..a8aa4b2ab0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_669fca905ffa843f4c03a02b3291a774.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm97ke11sb197qfekc8pe\"}}\n\ndata: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"3fmxjk98m\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1107510d-43da-4a60-9c67-e7674815ded3\",\"object\":\"chat.completion.chunk\",\"created\":1758274921,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm97ke11sb197qfekc8pe\",\"usage\":{\"queue_time\":0.095475298,\"prompt_tokens\":782,\"prompt_time\":0.06538052,\"completion_tokens\":35,\"completion_time\":0.088602443,\"total_tokens\":817,\"total_time\":0.153982963}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvtjaeb19wycn4taf512q\"}}\n\ndata: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wh2c1ns3s\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvtjaeb19wycn4taf512q\",\"usage\":{\"queue_time\":0.142698738,\"prompt_tokens\":798,\"prompt_time\":0.066935778,\"completion_tokens\":32,\"completion_time\":0.080420775,\"total_tokens\":830,\"total_time\":0.147356553}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json index 264120acde..d44c9ba242 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_58b7cd849da82831f201e290e2ba1189.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}],\"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\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp12c9ekesddqwr19cna36\"}}\n\ndata: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"mv8nh3fvk\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1503c674-dab2-49cd-88df-b8c8a55e7f1e\",\"object\":\"chat.completion.chunk\",\"created\":1758275340,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp12c9ekesddqwr19cna36\",\"usage\":{\"queue_time\":0.143742763,\"prompt_tokens\":811,\"prompt_time\":0.065693101,\"completion_tokens\":41,\"completion_time\":0.090027569,\"total_tokens\":852,\"total_time\":0.15572067}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvs9teaztj1znsqv69yzc\"}}\n\ndata: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ppj486qqj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvs9teaztj1znsqv69yzc\",\"usage\":{\"queue_time\":0.166779493,\"prompt_tokens\":827,\"prompt_time\":0.067672158,\"completion_tokens\":38,\"completion_time\":0.088055458,\"total_tokens\":865,\"total_time\":0.155727616}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json index 358c74f414..77b6e7bea8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_a8f302e46da14449a042cb935cdab331.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}],\"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\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnm7dve0zrsq3r8ekwwjn0\"}}\n\ndata: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1vprdxh9b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-75fd3e03-65ac-455d-b222-f16519cd640c\",\"object\":\"chat.completion.chunk\",\"created\":1758274920,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnm7dve0zrsq3r8ekwwjn0\",\"usage\":{\"queue_time\":0.085546031,\"prompt_tokens\":811,\"prompt_time\":0.066794994,\"completion_tokens\":41,\"completion_time\":0.096887744,\"total_tokens\":852,\"total_time\":0.163682738}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvrxdeazbhfkeckwrjgd5\"}}\n\ndata: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"5fbnasded\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvrxdeazbhfkeckwrjgd5\",\"usage\":{\"queue_time\":0.167598826,\"prompt_tokens\":827,\"prompt_time\":0.067527601,\"completion_tokens\":38,\"completion_time\":0.094821719,\"total_tokens\":865,\"total_time\":0.16234932}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json index a8287c61c9..22bf7622af 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lLDS70dEpZn1h3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"tGAQBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"TEIwwKOvE6Fac\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dtqU7OP0wUSfuu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"cXwVeOtrj2TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x6QTvSjQXgxAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"zariir5eovXWj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8ujegY778WaIe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"oxPmtqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ssG21khGeO9GoO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GDYCDNWdhRW3F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FaS5iQ4JI7tZn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"W29Yrc87i0pjIzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fYWCCerpDwqeX1x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rQAR1U0sktKpT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"3MW2sBMN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B8ccwQ2aamnnH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"bb1I1KuORAo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"c8dRLkteDyI3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"YjMKKwnMKI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"onjXFR3581BC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"p7e04PxPKuFrt0w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"GzKI7kuxQ8OVs8e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"sbAlS0bQMYYAwp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"AwUF4BLJrIDZoTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"0oum2oxQnQdV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"HuH6ej7TDfZSIXX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"srlXzteyhzAEN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uD687CAXhxSHG16\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"hO2OoTdF0cJZK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"1SvvlkNPttw0yQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"YJ3nF1UuQCDc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"i0sKvB1mrzU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"a11VHJt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"H7549kG6sojeg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"d1DOx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"jE5c5kaOejSJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"X0svLeb14\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"FV1a7BnTGu5E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"fqv8y2i7CTkbv7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"ICyzWuXgSip\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"yyMLBmU8cd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"9oM5GtLg4VseT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dSZZs4fg7FGaqJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"eQRnSwFUVA4xgA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"R9N97nBTkMCCgnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"9blpebQtLPRjqE\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68cd27f65714819595390d04521440460a40899f4e5b71e2\",\"object\":\"response\",\"created_at\":1758275574,\"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_68cd27f6f18881959bf449469b4a675c0a40899f4e5b71e2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GywnFORIrVDhal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sTnNMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HgJQ63ZV1J2Ov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ohVH5nHarT9Qph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yE6Xb3FJirn9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"E8TdyY6Cj9586\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"S9ErhgY5TaiAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7sxujv22mXZ4N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DTEzXuv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"vZZeMff5q2BRKa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rLabX0ifg2yps\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ew2HWIkg3XrOv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"W0abyJXCy75Rbm1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"29XGvMd9wMbKFwJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Axh3L07NFW4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"RdmIbd8D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jDM1PZlTRWxRw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"23XBGu2xUn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KPCOBNWOF0iQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"jBpOwGeMPw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"WldU9bHhreG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"yTZVTYQZPw47fSC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"92L7SgIvEb1ndVL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xaeJugs6eTHvuV5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gFiRRKaMXOzIJd5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"bCnVNgSNJorV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"zAkOsBKHRhcNGqK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Lp5ZGSncH88pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CH6Bnu3lWEngCIh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"tZZ5e8ROZTPSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"R6c7TUCoKHOIHi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"fFFwoAfIYoQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NRIb3Bg7J7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"550xJe7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"k38vD379aecSm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"mioFXQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"hUsGjFx35bDDe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"e0A1inZ2h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"xnznzMOKdp3a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"N1LwcSNGqSK5h3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"FIPVd2RlNWd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"b90a4fYZsi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"8ZgBWto6SGdjF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2fcZy0cT88qm81f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"O1RotYHg8NuHJq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"eHoES9WNrQ4dzjr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"gZVDvdphiY9m0e\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json index 29154366bd..c181e5cd27 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fKJUDWzVplehKc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TAJ8I7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"OSHyb8PYZRlIG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2YmgvSdoczzTmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BRfHvyyVqKHT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"k5iGRBKNtG9tJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"2cj3RWRJr3WWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3xe2uAKqpayew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"suUbTcR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"6jM6g1ENkQy1Tb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ew2q93Y6WBML1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LpLucnP9JxHSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"I9wTPBUA8ccH3co\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NcxJaddy9mLeUtH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4BO8AeLG6p1Uu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"H9hcubn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l44O1Xj75xFWB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"bFGcpUAjTfM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"bcR3pRQegJlCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"DK2R6SROUY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"whVDJf1a33OL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GT5K6y0EgVHxXor\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"AkRBZMpcpVYY7x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"flFlxAwUoX2Cz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"RByof0gIiYwqTp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"lvTA34f1XeFwCFZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"UPzYaHV9frob6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"HSHetRGgMRoN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JQH2xO7yRk7YiPi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8yu4CWgbxsq5x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"3tW5iKSbdYxrPb8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"QuqtJSa7gWkKTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Dp9sSyYFSHfNix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"JzrO4T4pSuOj1C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"qBK3xpmFBUACJVY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"gdQATPG6DsWJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"nrztHxdy1Dj4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"JvzpkiFnPvisCdm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"fTCulMknWVp0dO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"mIgMm5ih07KDzDR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jdtSWZg0eAJaaD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68cd27f40e5c8196ae381a0eac55493d0193709e42b90b17\",\"object\":\"response\",\"created_at\":1758275572,\"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_68cd27f512fc81969b9eab4b54d16f880193709e42b90b17\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"A3v3NqFfEn9D5u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"koFNZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"I3JpjNQp9uyXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cOg7c7qeHFXnYW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QbjTZ2Ww78Hj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Fu1n7cHMwZRpU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"aXRBWlO2lv8Ud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9Yhzjl7z7iWFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"dncrvwR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"9krjlTwq2wRvI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nMT7r7fVeUuID\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"GkAdP8KuWmYf5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Cu8cPQGXDWOy7t5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ccgTLwSmQLVuL6J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vCKCt0bJHDOAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"paX4stgA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WJFQniEIsEkBO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"co9QM3iepHU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"v4i6ndVm3w04J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"hWCcDQeYsB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"rtiakUnUY9zf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Nsu8LtynZR4JDm8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"MOCxtX5SYOygWJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"b1uphTjOCZT0QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"0MovI8CnzazdgM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yqEJ93HyMKbSCQM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"6fYn3V0B2pI57u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"2poeHryeaJF6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Yxuegn2VjTIarr9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OukUh4SRIW3r2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SaYOaN9DrPL0Vtm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"vi8uivoUmmsNLO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"0gYkcizkZ4Uezw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"T5iwhxQ90DmgSH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"uxV0EeMlXVe1x2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"6eOJaEv4FquCH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"7ULTn27GvWIC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"sJmk9xy9XUY6hUH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"A1kzjaobQEUnf1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"2zQ0edVAngWxMt5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uyWXHTZhVmKwDa\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json index a95ad8be64..d286cb632f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FqbAjG961vQDRm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cY8zC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"xqdNjNmxJUrMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"frK5me0VsFqWtl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GqOTFhh5Xsa8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Mj1SxJcnHe80n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CeDpXab6b4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ktYnDd5KH6luE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Z8Gmh4eAYY7dB8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FjA7aidHMkTJR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fcjKJK7mvmZ6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"l2Fs7hMEiZ6IoPz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MQ49TkQcKk1RQYP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"M3UYu7vMQuzDA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"VcRvAeN03dh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tRdzO8RIALh5n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"eFGR61m5dMQiHif\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"XijVtfePA3RbOWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"DhCGokCjAP0s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"4FeTUTCWRaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ZZLBGSTLqE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"hOUnhaNEOO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"L2vYAqBK1BL7R1b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Wnxnrbxzsg5Cti\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"Y4Vdi1xieZAKjJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd28124e848190b6e8c0cb4cc266fa013fc4bf12b41c67\",\"object\":\"response\",\"created_at\":1758275602,\"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_68cd281310b881908cc1d3787f576490013fc4bf12b41c67\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":586,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":614},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k1i0yR8zM4y4Gs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"2kv7T2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"uxO1cTcF8fOYs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GyJvJAtidrmzcP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ms51Lq6hZwHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RpFj1Q3tdbOgV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XtBMgZcNBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TRcLCtT9aK4s7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WymOrauaQwPald\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tnhlJI6aPe382\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O3RhtFMGuwKvd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"XV9RrkJfR631bcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pW0cy9vI4xmr6K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LZdAk00gOtCph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MagpkIGXevL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Fl6hD86c0Vu1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PeLsBPiqjUGDsyL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"IogRuWudDO3kYFE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"lqo0XYUU4fy5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"kGm4c7ctYX8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"qPAYYF1YtE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"AEAnMyMm4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"yIGnPjYfKsSBuVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"5Xmn624oZQDHi3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"XqnUzclGAPWkqG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":586,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":614},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json index 7fd5a03b38..a3dfd9058d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"sTxreD4V68a0Nt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"BZg6M6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HT5vLn99KVVRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AADFv5u9dYAdWK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"fNz0E0xYs90N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"USTZqQqO6V1qJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"eId95c7aU1yXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3r4IfZKz4i2fj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"I3QAgmP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"Zuvz5PlmgBcZK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CPUHupl7fSadz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JcP2dbuwu61iH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"1Rm0K9AX3xl4RV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"MnpYtdyiXvnA4wi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fUXnW0rkbNFW5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"HcOwLwHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nXekkAVJw3W6g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"s9260hknmL4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jPqXWpgB9lgFh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"5mNvldmVKV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"mkwN4TpwuaND\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"C6icdOuj00soMkq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"bu95II6D2NFMx64\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"ninVZAK3BeD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"ojJDN2bIPn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"ZIy8cMZTNB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"3rrsF34bp2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xk4VtVwNLneGqzm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"nK0hQVv4Dc9jn2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"VnElsREihiiUQYs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"7GQY1vYmgQb4TV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd27efa2d08195a6486450eeda79a100ff7f49c1e535bf\",\"object\":\"response\",\"created_at\":1758275567,\"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_68cd27f32af88195a8844c3c65a56f0400ff7f49c1e535bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HAQSbZqfvxsxTV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"GYSji0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"aXuMX2DWWLaDi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"THDLzOKw6P2ctf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gotL9CmEKc3F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ilOHMIcoPD6z6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"oR58c4r4vGDAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4GYxLBpLkTtfc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DvsJa2S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ropwIfpWQ9ZOh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w4wygBOMy1tl8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KothJH3CiWMk5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ahFFybBFvuqN3qd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"TLUy0v20PDlq1nf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3lyQvXsN356pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"mXYp2Z6f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FJHQ80xKguvwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"4z7Ac9gA5cG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8kOoDqqqMsr0E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"rAJBg3vwbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"h0z0rZsJuco3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AHQeo1d4CAOt6mh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"U4sp8qNpwhBruYp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"LklHbDvhVarH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"AhGAlQKF7Wh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"HLAPEOZSS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"AsCpk6QfTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GL46m8qDnNGGocZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"d71a433h0ekCki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"3de23wna17sQgyu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"S4yzEhCl6l7ub7\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json index 0dc55be281..d0d7cf7e10 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6iq2kLAQS2Np9f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TTWOFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ym6ydhfUK69Bf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GQJycLr6p0g598\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"PxY7hKxeeqY1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JXY2fwVw5JTF2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"TkHufNbQqAmko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wiOzj4NFOKOed\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"GEO7xCL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"OnwDOLpAQul2Ok\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"t0XBjxv5gfz3O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Uyh1kA3E3Ku3y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"byIB2Ye7xzPlApK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HGcI6X5XdUJbh1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nUcvYTxwKNe4g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"r4XxFqmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MpuHi5ubWlZKB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"DwKlKNIUbZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OZzdAc3Ovwn0v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"ln3NdVaWzf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"7SGv8D5nrIRg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UWcvwuKowySiMyf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"krImvP9Zt4fkqJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"qhxzVtZuHdof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"75V3OqDmHxx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"cPCU2fUEzD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"fc5Okr3wzv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"t6ZItHldoT2zN4d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"a1UEj2A9gDJhsf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"iiW2ZhygQHNRphZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"nDsomrUhjUvJSZ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd27edd1c881978e1204b7c8784b0f02f084d22cb584ed\",\"object\":\"response\",\"created_at\":1758275565,\"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_68cd27ee6b908197a3856199e7a51aa902f084d22cb584ed\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ST7hmAhxLBWRyW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"p7kiCa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ieKdfuQekD8bA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"WinOYb2xZ2wOgv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"KFHt56kol9uN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"660VyeI4rKuBi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"6AlG1kewudiYG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uQiYKnqxZVCb1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"b3YkaM3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"DPRyxFsOzvh5mL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TJzbBgdbgmu5s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LJzyYXiCcAmT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"rkoqLKEbP2KGNi6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3BkNCH0sqUK5BnF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QdsJPSck9vcdL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"mZ8Up80E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Cu0KQROaDBB9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"23EjSQiixO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"suNlAsGZ1KEf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"q0Hwal1vCg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"Fk1KyF4RxqZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"c6B350EPUpMz0D6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FGW1a64mOpcj0Q5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"sMZgVHZb6gV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"J7mgS3JDf6O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"pHVvwZXPOw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"wLOSvGRTFK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"nH8EuPAdQHOznc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2bHumg9u1Gz74A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"kvFamJ63vIwAWpo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2hudeNiIT88yMK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json new file mode 100644 index 0000000000..4adbb2ff16 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mNPNQT94A6KRAN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Z1Tzon\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"0KnOuo9Tq6s5y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"TYc1SASzrIJOtD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"nwCtK3SrK1im\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"v0YwD7bQbhrCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"39lw16q0QcwYv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6NlFYGdCVL7iC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"lmlIyHd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"22WqhvpEJmwYfw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"OKW5kLaXsqDJd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"sJWD89HHz1BLp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"eDn9cGe0nacR2cu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ISUjweRZPHbf6O4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"yEXZASelTbYZn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"NIGZ2aZJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jJ0treXb7f44a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"bgVfFsY9CUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"tgMzDdHDrtNVT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"pxZ54jnj2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"h0t37hakS8oa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"7WppjpHi7zgja7Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"lCGVHQY6JViavJa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"Gz8nhg5h62TK8Lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ZOHnn92TvETAb1p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"Code\",\"obfuscation\":\"2SSoixAODto7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"4xsNSVQ1MbSM0kB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"eUvgiZxmVcIqa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vYGwOi1r01R2F37\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"pre\",\"obfuscation\":\"h2oygSHiekyi6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"644XYomIpSpT1Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"code\",\"obfuscation\":\"UDrpSxEbOGnE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"1teUyUaTH64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"-language\",\"obfuscation\":\"Rpqmme9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"htRZDyXDoUJDn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"javascript\",\"obfuscation\":\"2B1c3d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"nNHskjyDh7uZY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"console\",\"obfuscation\":\"gzOqfsSOW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\".log\",\"obfuscation\":\"5FBHafQQ1Q16\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"('\",\"obfuscation\":\"Yr5jtlUGUifghB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"hello\",\"obfuscation\":\"6AkDAO88yEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"tsTpYQ0OWW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"');\",\"obfuscation\":\"4XXmTTpo5S27l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"qgaNvfqktcoZMdt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"XQ7WPvyWJkdwFz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"g6SJsGI14Jzz6Lf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BXPBP0qUJRpm6z\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"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_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\",\\\"
            console.log('hello world');
            \\\"]}]}\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":569,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json deleted file mode 100644 index 2c16a6ff53..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_d992c1b0be938939bcc2da485962c78b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JAh6YSZJGw86r0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"quUAa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"DjO15r1CWhIiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"cMn3Ch2GmDS2FXk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"ArrUddifDlZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"q2jy7uU2112yIz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"PuBjPYgmc0ay\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"FQh4CxrtJCTszz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"oM3D9C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"nX26scAWGA5lAr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"OWiveemfflJ11u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"4QGvOO0gNiwf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"6plBw4dXyzThFsp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"oHXOpCBElh4i4mY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"3FKvf67m38ME5V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"nLzwskn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"LDuiuOfRHjQCk2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"after\",\"obfuscation\":\"OTqQyFtq8U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"VIDIEv2ClnzIWM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"vts08SW0I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9iHVmrMld6NTB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"z1OxmER5jzvvLb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"EqoyTRiy79mmf0o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"GRWDeObxt3Z0SpC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"28DknyOl3XIiLVg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"Code\",\"obfuscation\":\"JLb5HrXqnTrx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"j3TX8ReIr1wU5wh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"aMKcpK7q1OH5yU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"7ep72xxfk7fLa9D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"DJcgrzu5E5H8iY\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\"]}]}\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"0mjPwrAB5QF4LU9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"hz2RY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"4OQVRnoJZZ9sB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"oOfSTysekZWHsAd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"1XscejVV7DC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"lrK9ZAXV3WHG4r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"add\",\"obfuscation\":\"9LIXxXMEn16l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"KLASRmtFUuOvkQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"reference\",\"obfuscation\":\"xgp34h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"Id\",\"obfuscation\":\"bRVt8ZuEkEtdxN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"6xaiA2RmnjOfbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"uqxda9IvwUcv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"hPLKajTtWlcN4MY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"zIgzfZ6cT77gcTJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"akv05VdcA3ZGSy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"position\",\"obfuscation\":\"FEfdp4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"nvHtfPcKPwsMzk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"after\",\"obfuscation\":\"DfxNLWXEgw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"YCY6jkAJvf9zsC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"blocks\",\"obfuscation\":\"qQDM7NnGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"cWgZRu9m5Bv6b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"TQhZ79v71qg81h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"pre\",\"obfuscation\":\"uvTdz0Odf7gMM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"><\",\"obfuscation\":\"fXwtN9wykx0iwP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"code\",\"obfuscation\":\"uMtojKUKuzv6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"JwsQ70z3v7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"-language\",\"obfuscation\":\"QkmCGZ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"=\\\\\",\"obfuscation\":\"5U9TjGHNUu5CG5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"javascript\",\"obfuscation\":\"QwsID\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AGczCrASW1wBx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"console\",\"obfuscation\":\"ChwxAFz6k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\".log\",\"obfuscation\":\"3qPGrsvan9sO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"('\",\"obfuscation\":\"mgKUnxqVzwuNgz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"hello\",\"obfuscation\":\"qVPe1xtGUcA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\" world\",\"obfuscation\":\"WjUaskONiE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"');\",\"obfuscation\":\"RhgwUCvuaC2FA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"m1lHPhlrINupew3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"\\\"]\",\"obfuscation\":\"puvN2lZs7ryZ6q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"}]\",\"obfuscation\":\"Avs4Llpw2QvxEm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"GTr7T8X2hNsgcCm\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":83,\"item_id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            console.log('hello world');
            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":84,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            console.log('hello world');
            \\\"]}]}\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":85,\"response\":{\"id\":\"resp_68cd28e547e08190b3f026a99ba5b72b0f07bb432735d73a\",\"object\":\"response\",\"created_at\":1758275813,\"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_68cd28e610bc81908551406a8bead6160f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            Code

            \\\"]}]}\",\"call_id\":\"call_pzFY1GUgriZLJtEsO7qPB8fo\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd28e6d78c8190b4271cc3a3bca9170f07bb432735d73a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            console.log('hello world');
            \\\"]}]}\",\"call_id\":\"call_AlsykvsVJEhjCgA6zzS5mgZS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":558,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":114,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":672},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json new file mode 100644 index 0000000000..2432b61bd5 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"iGrz7yphswd3wH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"QbQtQs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"a8OqIrMZEBCnj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tY2UEQFGIRAg4u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"LNjY4bsypjdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nQHDXVJFth5pK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"LqGuprYr1jbDs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"x5yYfwXXD8Vh5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"GKxv2hE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"o69dAogCrz5z5s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jjFoRIUFUXbxK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"sbYOqygk3kjfZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"u8Mj4V4b5iZXRXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pgHak2R19piWqvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8hQlz4jqgEuQL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"3sLRgxSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5689994pQ3aBB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"NfU4aai9WnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"YwmtL7qTbbYpi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"KKwbq51Ys4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"b71xUN4l6Rcb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"iW0XdLRZ3jUxioJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"WzbiuJpgtUfTeW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"yzmfj6TEMvHVGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"tkLw9bU2vP1lSo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6eCMolF6qHsMCjS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"XDONTpaJt0rcjl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"i9T6PcLUMCj8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"y8m974Xu7Q5LhEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"J096nIJU5HGUa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"fAOqRHmPH9rNXmX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"jnpFDJCrTykbWE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"ssus9rJ69ciIrM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"mSMypbYOeVr3Z3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"uOYIpcnVdmDQJ3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"j7O24CrrkFrMS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"0Caku3AXkeEj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"59wTuhg1lYcEJNh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"5vjLvIcABOuR9F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"F0T6J3MOx0iRa5o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hRiynlFtDvtg3T\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"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_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":553,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json deleted file mode 100644 index 9d08d4215c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_e6f70767b9e3370015490920e244c4aa.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"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\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"nLZfeaizMQeEqB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"bsBMML\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"tEuk7neHEJhDq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wn6QoA6yXe2rt8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"rWCi4wshFWAP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SEZq116tcczhK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"jJJMPSsexGgoi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hTpd9MtQRDlQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"73oGG12\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"x5nneohEfsWXs1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Q9RdVuxjEkwN0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"oPMc3Ku2Zgx17\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"U1QU6F3DRyhSzZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"3WcZa56Tpv5c2RA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"iuiC8eYNryYQe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"smnDDM3y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xvk8Iisvqz1my\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"AH2BUqPt0zc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"bazkC5KpXdptF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"FnGkAa90wn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"aGLclaUByRJx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"soRljLybboGCFKM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"QJS4tQabXLJ1iJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"ly0ni7nisjyNzb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"261mi9t7YahR8Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Cw8xIv8Mwaz0JyL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"xm0HgazYQ13VEM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"dut7w8aE0UQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"oV2erhgFvPTuZiM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Er1kwxhktcI3x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"so8ILnFNs2Ji2XJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"TtJt6LZRUSLS0Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"NUpsEFerIaXEc7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"wNdVgBV8zyPbvD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"1ptmE8k2QRPQM5m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"134JfPDXkPUvT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"TYeiGmM4Sz2y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"ie2U7l1j5XhyfFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"ZDP07tNSZ8NfEB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"rbHAH6F13eCXgCU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"u1LpLRWBiVoPgb\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":52,\"item_id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68cd28e3837081908d2ac97b1429a79f079ca408da492907\",\"object\":\"response\",\"created_at\":1758275811,\"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_68cd28e4702081908d19b7941eb56715079ca408da492907\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
            • Apples
            \\\",\\\"
            • Bananas
            \\\"]}]}\",\"call_id\":\"call_kRp4XL3olnt68TOKEiUnhg3i\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":543,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":60,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json new file mode 100644 index 0000000000..2c4a66c9a1 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Y75q4dMbqo0i0F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5Szn5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"gF1RVlRvQjdBQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"EAV3WrpNCsmWQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"RgQt6wogD5uk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"K2LhoQWgAwXBQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"zDteKxoYkq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"XDBiHyHQgB6mm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"YraY4SG7MTl9n9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SSNuJWMe2mtjj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FvwEkS0UdGoao\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"NfP5f90sx2Y8ZOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"bpDpUuE1upDu6qv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"yMy5PeBXXIAJK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"2pZzydrgkFK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5sxXEpR92t6Us\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"CkoFD0pZqiStxN4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aSGko9BQgEJKhjS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"Xzgxue4i4jlj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"3IOigYcegCb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"v8xzV9fyDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"0zwJ9sjRox\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"1gDUqnVzprAPpDT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jUHwctr3bZBmEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"aG8kljt4onqfK8\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"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_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":523,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":551},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json deleted file mode 100644 index 85407d124a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_64d30b1e7e1ef3d253c7a06fddde6889.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DKaooWSRF8bLSf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"MeThu5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RnMtQbJMvIOpb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mQAheo7SQNwoJH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Y0ypofTOrLJR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GyZrrxHTBM6fn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"P5gnZxardQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FoJkPhicKQioc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6AO646MpaxpYdN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nvxa4E0Nqtk4T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"lMc1RT9JGn5FT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"s92agGePHXiUtF9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"rnFiomeJA9b0dw9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9jpTfjhSt69dW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"KROfLej4phT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"62ocdQ8kldbUx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"P7zFeoZshiCufJ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"o7zAdYMFpU3MwJQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"9h7drK7NCgPD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"hNb8NZB51n3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"drrKQofW63\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"M9zZdGRYul\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"OXuD6wgpoN826RK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"D10szI0E3VKguU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"yFL7SRoADuQd8H\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28e7a1d88195a7247475f78fbb16099029c8611341e0\",\"object\":\"response\",\"created_at\":1758275815,\"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_68cd28e83d488195a43a11662b0b8778099029c8611341e0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            You look great today!

            \\\"}]}\",\"call_id\":\"call_IPwd5M00NHiuKeVYeEXVr1ZC\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":513,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":551},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json deleted file mode 100644 index f491de5e4f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_869075fdc1903bdcff077c9815e352cf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"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\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wVq34YZJmUqgQZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"ZW8C2g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"dTKXCEuG13IOU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"WdWe5oP3Wsx1su\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"WyBkMR5gMIm8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"U9pmP3YIfYhg7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"OPcEBpClq6L8L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hdTsPRHN4n6Vb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"0APCuNQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"vMdrr9MDnhC24L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"mjcCzOuDhm3Qm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"id2j7LRsc3W5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"Dfm4Zsh5QGABL4v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"TIIIUIbukh2BQiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Oa2UovaE9Xx7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"zXI2BIs5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"f5eKmmbiLb5bv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"v9IMiKtWogP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"OvlEi2svHoXWB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"luOKUmfV2b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"1VHJhJmcO2hG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"VtN0J77aaGG12jU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"rE9Xh8OkT7off0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"b45EQhf7xbsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"HwT6CerN6FZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"AV0aVkOTGs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"CR6K6pO4rb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"VDQvxwo3WC8GQ0r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"Ewvqq4MwVcBID3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"M4euajfPe36JX0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Fk5wAHfrB5AUBy\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd28e1e790819093d0906cff2d04c30014e445ebfe1dce\",\"object\":\"response\",\"created_at\":1758275809,\"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_68cd28e2bffc8190904504a0da680e760014e445ebfe1dce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_S3JFjUBR0wT8cJDR8CwODIWo\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":541,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json new file mode 100644 index 0000000000..17c296f535 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"7SpY2yZjylJHOT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"DjaUTg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"i1ncoujuPVO4G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"7Y1qAD6j9euB0y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"iV3dEpTQMjYO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hdrl7PKD6SoI1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"o1tsmFrN7dMBO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GxUe1QQyIjdOU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"EaT1k6h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"vKSXxLbCsiaWCv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"e7xHufyThkOUn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tPRwPLzpYKn77\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"cjWdk4jeFyxzhmx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"s1CUZtNEmEF3ujv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"d7tG9ZQWBWBcd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"qhjIbdL1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yza4aJT8t9np2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"fgoLLV99agr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"h6mMx4n7OwyTB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"av4ywti1I6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"LyehxKE4JLmk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"i5W2pPCGURVxvH4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"3VgHwKUxOZ5yZ8a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"LU4LKtUWn30f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Nr1Kojc1Xd7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"E2uLgvce5F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"t1czlG1T5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"qIS5yvxY87LcI5X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"eFIn7dTsJmGiP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"4RwM4gItyZhp0mU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"P8Dpe8pYPmy1ar\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"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_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json deleted file mode 100644 index 19dabbeac0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_6207085019334e4a371c8adaacb140af.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"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\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ERAom8dEWRvprG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"30grEo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"4nJmFoocR9MY5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sAUFlA25q79zIf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"7RxFVITwJvbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hIBJ6TMWIj85p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"Qxvv9nzQCyKxX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SXnw2hwssChVD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"IUKd9u5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"3jONIA0OpiEM0f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VETxyrftx9jRP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"9fRLQ5nZboZKN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"0IkjcTdKbgk261o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"NTVM1M379WBYgr5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"H1fj49PtwYBqA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"aXoY0mxS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"huCxtWhICVIO8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"0pFDoZKn3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8JYhikW1YJUA9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"WNeEEgBuzB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"2vN8JZxOi0rU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"aVSdOAYViuO49b1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aiipuph7JtJvOSt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"xnTDiijTUJq2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"AiWWtAe518x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"gLgaSVOPdK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"FE3JeBau6B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"dNrAgq8sl2yLrQn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"nbf5o5KtXBOHxq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"uKIvMpv9jmepDBo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hZvKDx25OwY3FG\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd29234cd48193ac5a7fb3bb988c250271670b75650c31\",\"object\":\"response\",\"created_at\":1758275875,\"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_68cd292404cc8193b6646d1533b19a1d0271670b75650c31\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_rlCFtSHrAgsdzmoVtPWvNmGq\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":541,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json new file mode 100644 index 0000000000..187adf0e7a --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"rSW9zuiSsjANxZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"skL2jM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"SFZTsPwNoRc0W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"CTRZpTzUEyN4sD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"SgAo15TINziF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"01uigxgxcPz7P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"1lqvZEr5c6z8q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"KI2DlCAtMB3J2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"wqYO72G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"jwkxER1WOUu6uG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pdCB21VxBupy8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"TevthtYZUb7N1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"76uenp9jxgMry6P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LCNXFGL1pzy9uZK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VNSHubyaZhkiL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"ui3fBnEK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"oukXfJFoba7Ke\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"Ab8OYNncpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"i1hnNhhnVQZvi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"ToRXgK5IlC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"ShQeYuNXouT4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"hvbuvBAK3O3m6XN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"avSnYD4tsEKXn1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"ITBtBAtqah0G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"m4iHe1aYWc6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"0XYBExKWuO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"YYeQi3jqJB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"W3IFiU0qD26fLfv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"x7pchBLwXEuWeE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"5CqbGVuFMc7nOGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"r01rNL1yOI8wNq\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"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_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json deleted file mode 100644 index abec0aa7d0..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b818317df42c5cb1679f63409bfb31a7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019XyfNqUjrnfQHHByqyqbLM\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1267,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph after the first one\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" with the text 'You look great today!' an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d translate the first \\\"Hello, world!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" to Dutch (\\\"Hallo, wer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"eld!\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NiQeU5XsHrXmUZ8gMTj7m1\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"loc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

            H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo, wer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eld!

            \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"},{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"refer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"enceId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ositi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"aft\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"blocks\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":[\\\"You look g\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"reat to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1267,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":170} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json new file mode 100644 index 0000000000..a51b3e0f94 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01MPN6mesfc8N91BT7gikaug\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_0163FFTSPxh7ao14Rhay7QdH\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perat\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", wereld!\\\"},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"add\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"referenceId\"}}\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\":\",\\\"positi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"afte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r\\\",\\\"blocks\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"

            You loo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\"} }\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\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":135} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_8b91d2f21694112af7f45ddd4338bde2.json b/packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json deleted file mode 100644 index 4e170d431d..0000000000 --- a/packages/xl-ai/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_8b91d2f21694112af7f45ddd4338bde2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015efjgzPcm5JaXpWsdS8UHa\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1077,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll help you ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d a new paragraph at the beginning an\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d translate the selected text \\\"Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\" to German.\\n\\nFirst\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\", let me add the new\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph with \\\"You look great today!\\\" at the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" beginning of the document, an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d then translate the selected text \\\"Hello\\\" to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" German (\\\"Hallo\\\").\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017Mj4wAAUpHKuLm5YU4uyUT\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ti\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"referen\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ceId\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"position\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"befor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\":[\\\"You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\\\"]},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            Hallo\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1077,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":209} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_ae989a416fa1cb51342f1da4c5bbe105.json b/packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json new file mode 100644 index 0000000000..92f09f21a6 --- /dev/null +++ b/packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015LkpLmqH4rifHr49UKGQm7\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017KhpzMZ8Y41ZQHU3r8V6jU\",\"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\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"add\\\",\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eferenceI\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"posit\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"before\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"blocks\\\":[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            You look\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great toda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]},\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

            Hallo<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/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\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":132} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json index c4347de726..5e5a2ac472 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_caba43c1afbac54e222e8482fe7140c5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"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\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnp2hde3b94mpn9ttzpm0d\"}}\n\ndata: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"24zqyqf56\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-609ee861-b87a-4610-b4c5-9b89da902b2b\",\"object\":\"chat.completion.chunk\",\"created\":1758274980,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnp2hde3b94mpn9ttzpm0d\",\"usage\":{\"queue_time\":0.123010247,\"prompt_tokens\":943,\"prompt_time\":0.108716759,\"completion_tokens\":64,\"completion_time\":0.171260519,\"total_tokens\":1007,\"total_time\":0.279977278}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhk3eeeka9303hrj1bnmmj\"}}\n\ndata: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8d66d348a\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhk3eeeka9303hrj1bnmmj\",\"usage\":{\"queue_time\":0.088422372,\"prompt_tokens\":959,\"prompt_time\":0.078587168,\"completion_tokens\":60,\"completion_time\":0.133440472,\"total_tokens\":1019,\"total_time\":0.21202764}},\"usage\":{\"queue_time\":0.088422372,\"prompt_tokens\":959,\"prompt_time\":0.078587168,\"completion_tokens\":60,\"completion_time\":0.133440472,\"total_tokens\":1019,\"total_time\":0.21202764}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json index fb4d7fd758..2172f8501f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_470eaa199fbf28738ba71696a4ce5010.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnp31gfj79vgmme8vv720f\"}}\n\ndata: {\"id\":\"chatcmpl-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qakv3aph8\",\"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-3570acc0-27e8-4016-9385-e8522ce8ffda\",\"object\":\"chat.completion.chunk\",\"created\":1758274981,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnp31gfj79vgmme8vv720f\",\"usage\":{\"queue_time\":0.10705839,\"prompt_tokens\":768,\"prompt_time\":0.065262303,\"completion_tokens\":61,\"completion_time\":0.147387313,\"total_tokens\":829,\"total_time\":0.212649616}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw2p6fxsb8vkf8m343fpg\"}}\n\ndata: {\"id\":\"chatcmpl-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z4dzc1qb2\",\"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-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw2p6fxsb8vkf8m343fpg\",\"usage\":{\"queue_time\":0.086536756,\"prompt_tokens\":784,\"prompt_time\":0.064184677,\"completion_tokens\":70,\"completion_time\":0.162873336,\"total_tokens\":854,\"total_time\":0.227058013}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json index 1480f30b8a..8578971a57 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Ev716GXYeyA2NS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"XuTQDv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"LBnFdP0rcyNm4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2iUfXaZhTOOPRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"1sEu45CL0ls1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"6P6AwgJF5bRUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"YJsQTCBRpT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DL6CkTBIF9lao\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"S2UpDPG3dYclYJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IIIw7PZoUQxa1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fN7K3uJHT4atd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"oWrHxJBdG7lEeZr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zeyRIANfcfvQWvs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"dPYLQMORZX4op\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"GuNsjoZJma3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JpozaIpw0sYqY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"I5bn2S9d6sXxNQp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"uvPc9IYdNsVGY9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"nDUsVAgjnwX9VED\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"ieLpZ14f9pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"lfOz1pS9LZDRqLb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"9f3Lfh8QF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"PNfP9M0P96stDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"zWT7CXUby6P3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"XT9rZjsnz2zL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WtRmOEJGoqEm4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"5Yj5FCmpnKUgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wZOG5ikLOUzrr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"aPtxLaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"d0p2p3UlVtbfvq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nkDTJToEZSQRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TjZwxK8MjVgwz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"t0HWZDyXBz4DApS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"g3X8g2vEAXMdEXM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ISOjB2TIxG3xk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"NcAofyI5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PF30SqX5nrmIg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"NyriqWFOMlX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UQB5HRm676qKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"IHzoDTqV4s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"DXt7AiD2mlFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RgwXDKUvVyD2CwG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"GxawDrHuRVsYCrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"IvD7pnDmUldr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"lTfxAHtUMQy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"nxgTeAFgyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"aNTzqcXWfm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"3z7O1FI9xbcdwBr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"5IfIfxul79CCGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"Cd2wE25ZdahxiXk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"xSkCws2bAODOQc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cd28141340819385d8f232f8bde23206aa68f5afd967a4\",\"object\":\"response\",\"created_at\":1758275604,\"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_68cd2814dd2081939b7f20e866b63f5106aa68f5afd967a4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":746,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":802},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ihzi7YlLVDExtN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DNXWg1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"70iOqF3Nugsi6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iy6NmUEFqKST0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"e9xahORMssW7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"C61oQz3wAoZD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"OvvM5aT00a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"d5zrl9WVz9zT3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bZZ1Xr7yVBwukp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yUiEciDlRu6mS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"AggPjdTg4urnO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"97CVMFfHuQEqMKK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RdXlUDWvq2VLUs1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yI6LUdR2RTNur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zrMgYg4veYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S03nE1hI85UfQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rzR63quDoEXKEYu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"eDpm5ubuuJuLaHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yr43F5O0AxNek0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Hq8lS1ZJMgY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vy775kr8RpOZ2YE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"WflGX5a6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"3htu0ITWrPwjzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"w4CBYUbuWcVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UYKQUEx4aN5j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pYyU68kauq6g8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"v1RWI6d2XL6Kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RaHjdRCK0HWRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"C6DVrou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"MbcIK3DhifVkQc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pIK18pUn2E6Jz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Y99k9WJxeTzYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"shR0Ri4t989suJy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"GbvBbfoMhcAR9Ku\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RPH0jdfpKjbnr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"PGxm1egw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ex4ieTPFcVc4g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"7stxVvWHIH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2InVBgR20h2vr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6ZA4Fdj86G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"4EQeYS2HPQxB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Nhf0JjYggxB7jtx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Nsm3MwXTqlVNQC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"xqxncdHhLLo6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"HGFKGW92JzD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"FOve6oEjTH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"K5k5olpFPJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"XfoxM136enH6yFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"wMLZS0LVohWwzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"1aGjsu6svw7Tz0Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OX6ZgfyP1fTspH\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":746,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":802},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_c6fb82e817b9dad69fb7d7369cac5784.json b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json index 3a085f6264..a6a56b3c74 100644 --- a/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json +++ b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"7jHYVCWvyIVp87\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"aLlOkP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"D0M359280WPar\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I1AAqmAERChnQ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TFVXCDyTiF5G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TeMw1katx8d39\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"sK2W8oxjz1oJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Q8mJiC8SCKx9M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"azEG1OX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"iY1hpVkDBYBMRg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LQLezVaZ82h4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"HpnJAjnaZ3WXg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"d7lFf0j97Hb0Ifc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"w2s9SUSHEZjxFyc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Euv2xcDactCQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"25u8EETg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Z11QCaAME2Fmb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"PMdmnxGWO5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Hs921X2U20Cux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"2fNusCnfgg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"H9KpR69PCfDr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VesFcjA14jjaRYt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NB2s8VmhwAUxYgl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"s8hw4HrQN6kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"G5B3uFliYzh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"KjIhqz7I9j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"NDnmPeE8TM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vhWZU1vDaIyfh48\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"Gvq4UgoEHA92pu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"oC8K25mOc8E8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"BM45XCCyivRd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5ZLuF66uOYGaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"52P5ithYEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"MufPUBpzURdQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OxgmolfjPNrKnQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7lCOuUQjYVwyz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"27qvbkRcjdHET\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"yKbu1eG3Pn1Uizr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"8x2IHAIfjYcZtsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gN1m2xZO62UOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zI3OsuPaX0n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wDk3X4668GAXW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"FirWu11KzAnqXhE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3MFJeyZgEKT9Vpm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SmtmAazHfag4g3k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Bn4PacP3PbP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"u70dCGSys3RoQZo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"PNUbYvvBhgUdUm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jgTxN2NzJ7aiHQ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68cd2815da8c819085e0efdf6df9404f0d296ca3fe84e5ea\",\"object\":\"response\",\"created_at\":1758275605,\"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_68cd281653a881908cac171c0a9cd8a20d296ca3fe84e5ea\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ahuf3ZuYE2eMJD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oSLgCI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"OrKFUR1wDTqXF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vWto6JQE06JK9V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"2PeHxFovMpMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zAVbzfi5cUtqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"rjNQkLOZqqUF3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yEEK3GZezXz4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"l8vXPn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"4CBAVhc6AX1AKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hqCHf1fLVLmWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"gyt8NBcz0DYSa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"NCQiHwoBDd6Mys1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"PNTyzw5Kb8bf5gC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SnWo5Gt8M7S7S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"UipSumDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Hv8qUlWtr2I34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"4Me5rgt5q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"134VgBQ2mTuuw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"xUGuqTOWrd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"lC0tGxcui23d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kwKVf4Zbo6wnGXr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LoVt8MMVTfcACCJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"RgRmQkZwUgwV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"hd2VzM1rJDJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"MW3cfbb13E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xz7jzf0h8l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DTMPhjrqCxQUmzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"NQwBChUOeODjyX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"1Sm9100rHO0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0culxhyWxMtT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cNQegYDFfoE7A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"NXjNsknJzq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gjJbfkpXTJ9CR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OuS7s5y1RsBkI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hPGFJN2mAq0qs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"HrCmnvvKY66ia\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Lx2XRHI3gszrigT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"wpXc7SfbA8lt80C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YVPZMMATZ14c1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"X3DzDRHRi9s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mgKyTUKBCAn3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"quSM5KcrLeOCRjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"E8jgyMmiCJeNtcr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"32tFoNjJcC3X0bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"0UOxqGsTEjX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"1MREcowmDkPFxyl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"CbY5w8OqLVtEGz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"of3i6qq426n4Xs\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json new file mode 100644 index 0000000000..3638351736 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"WrZX7ozwiRZzqi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"KJqeIq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"66NWai2diKBTt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ZxYfjck2QvVxtk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"yheL6itRm3BM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7zEZtjcFutYMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Yw1yKSjNMk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"uOjXCxhx6ep3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6GPjPQOlOO4Yn3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yxslLlK2OBATJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"MLJg8XwLqThe1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"K1ZiiQxkzOhdWzq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ChJ0qbUvDR46acc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PAoSSEtV1pMqf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Ioqu1Zu5QvN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ar1W0CVavHTuT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"ILAVvnWRDIi9VkJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iBDElS0Y5Wc9CXc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"HDRQK88w6PQO4Dx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"pjWvzthwfoG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"RveaAE8cm6rv4di\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" wereld\",\"obfuscation\":\"GKfcCjpAZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"!\\\"\",\"obfuscation\":\"Ugc5LW1c4rsUoB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"Q4K1qPOX9h5z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tCNvtQDn9ysF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VvS7iLyFDeGrc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"yoMhyRqWea8aa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"apgM66NGgJT50\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"osaPSK3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"BwTz4ROeNI6Qxk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"swUxlrEP2kZgr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"IQH3bvmcVAoAl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"3eoMtnCJ1RAKzUO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"wtPKIGyfzQKW5AG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"L3rpwK9Ygy1DZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"9wSaBvsm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dC1nmsvAfxlsh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"qk5jTi8mdqg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hkWwAfVvGr64C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"8t1sws17Jb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"iRBCXlOEZHDj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"a4DiedCOD0Oy0yd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1PWCFaWw6szQevv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"dXswvjnsb7iY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"9GXdDah8sG6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"PIB4B5g29S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"zVchUD0YMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"72fMSXvl66mqcEz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"bIRgHYfcv72BYI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"pCd0NNVB9A4oPDY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"3RvitBaBuuuVlF\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"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_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":683,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":739},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json deleted file mode 100644 index 220608273b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_e0e573f126f8dcfc1d1da436a1631ac1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"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\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"qV61P3QuGOukgAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"icjiV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fbNdOXozLWn9s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JzohruDADD24oZV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"WTWSjwsvVNH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"VqK78F7FecnnC3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"Wk9zfHWxy5by\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"OrJVVcrUr8A4eE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"8qA2bj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"cDZaJcTFFRfvrV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"cqRxDgVGk4EGpw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"OM15dTFXjDuv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6eZLWiyMK3zHNGk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xPWikkznlmKZEfy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"FDVaOXlIGCPkTO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"jMv28g6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"A86K3Yg6myPoLx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"after\",\"obfuscation\":\"EzAbKuZpws\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"0NmFIK1lzdBlXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"dv3tmReLy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"xUi4Betdj6NXK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"4TSbmPKo6ygk4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"OlivjpxV8A1YpPu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"T4fOIZL3mRc3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"2D1fHU7aLfD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"E9QFAVTgHf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"qijOXPCpOL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"0SII29XhG4FCl8u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"pWXWlq8mz2WxIj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"UfyRFJ8XB7SnI9x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"CjRnZ8lcmaywdq\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"l7H5vkIXvSr8zEB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"gdX5N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"dmyxdPTelIi9O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"0FuI3PBjw2nYUSa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"sXdTC7cBPXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"ZrS1y9ykRg75wl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"LHZFmIdCS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"IizlEARSauQK6Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"bR1cAUCIAVhzk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"vHCH8GwiPTPfse\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"UnuKFRocYOpZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"1\",\"obfuscation\":\"f9vKqrNyXAvbOpl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"RUmTgnDtlkKMo1Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"Ix1vopuV9ZSuyg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"2odqPVtRxq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"HtDybKIxwR840Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"fPXoZP6OiEHNMZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"yesxJLVl33MTVru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"9GWT40A4NboITl7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"uFIbgBnkanB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"eKtamH4PnH3yEBC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\" wereld\",\"obfuscation\":\"8BS3p91Qz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"DMDhu7wYivYee25\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"vrgISG78iR4hw8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"muA100sgxDAaleE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"etOVt2My2QxgKnB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":67,\"item_id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":68,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"}]}\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":69,\"response\":{\"id\":\"resp_68cd2903fff081939ca3d889cd5a29db03942662e3318cc7\",\"object\":\"response\",\"created_at\":1758275844,\"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_68cd2905c1e881939cd8171445171b9703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_KhMxD9WFlQUIBPNtyRe83res\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd29064db08193b2971bfe0eac5a7703942662e3318cc7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, wereld!

            \\\"}]}\",\"call_id\":\"call_BuBJ5BxQbW4tl6y7BuMQ9xJA\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":770},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_09dc8802102a3872a1bea73e45c076e7.json b/packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json new file mode 100644 index 0000000000..cd584917de --- /dev/null +++ b/packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Y5p6lrOBMlfdIu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"MGgQ2c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ahQ4PWyb7MIvQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9QE5naOgvFX35j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"T32upPinDQfC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"snjomF3fvOJpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"fYvLgFkjmSClQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Q3xaUYSBlEew7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"9QaWX2t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"6jUiTDwq5bO1Rf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1kC5TvDvlUPgI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"jFfvtZVKCbOxl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ihWBUSBvOS9fTnU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"dbXu18Fnt0oCO4L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"W6D0qEAOjtdek\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"8MKMOvBK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dIYpj0Xw8uuAq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"ZVyZ6FPlQP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Nx2dpmP5etTbg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"udm3fLzsOz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"79lXxXglvTOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"tO7sGy4bOrtSs52\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"y1Hm8g8zHuJAg9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"GgnY1irBhoD2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Vzo6PxpnppW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"XHTNsvfzth\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"BrQyXo05dH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6zIHreaO9IhkNdi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"RhqHBNzt44DBWy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"BPbcPMRaDg4W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"3mpwzQXtVwbH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"QGmr6WAs6jZEO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LQtHj0RTnd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ea24feVmpxR6H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"kSVRTmnKes8auO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GnOd51OFzBKNR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"jbEwwFguXTYTA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"gyjrx1lMIGSt3C1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"cNHoRhqUbgq0BIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"bOt7BpLYpgDM2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"RVMvWf2zZwk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Qu1ojwjDnTVoT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"93JhW3si4QMHT4d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"w4jXzuZkpKoHMO4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"xlYgUoKwMzx5UP2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"xYgR3woZAHX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"mfr4HWe01Ilinnu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"WOOquZFaWxLs2d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OZHDW929gPCB4D\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":57,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":58,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"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_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":508,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":562},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_796d3b3fb3726692a8631a770864f39e.json b/packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json deleted file mode 100644 index b28b446c72..0000000000 --- a/packages/xl-ai/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_796d3b3fb3726692a8631a770864f39e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"dBAYB7f3FxCmyJR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"zn80S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hJ06oiCzrTgET\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"aMr9OK86LQbbl0g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"8DVYvNKe6xR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"wBVhuJxsTh2qFu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"add\",\"obfuscation\":\"WDLElzpWL2vq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"euwe13w1gQ2eFZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"reference\",\"obfuscation\":\"4lPSOE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"NVhsGtOWY0h0P6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"9XKF8K0iM62W2i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"ZwRFpiIvBsa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"L7vxjKYqe64wasd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"zoYIlGc7dPsOK3j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"iDckMCZtLbJaIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"position\",\"obfuscation\":\"PMVwunI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"q4x2U9tmfM9ENO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"before\",\"obfuscation\":\"KFLiAFSqL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"SsusZllnmEgVF9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"blocks\",\"obfuscation\":\"LX00AfU7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ewyRhc6B4poH4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"SR5KERtdGkCdjp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iuKEZKO60xOUw2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"zig7TePmeqEm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Ho12xzI8wSs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"9qJMOZXMh1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"ULifAWd7ov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"whdxYJayUYQr3Vf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"bmD3sXIizilgat\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"FctAVdNQeIuF4Lx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WDFFzqzqcAmMjB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":38,\"output_index\":1,\"item\":{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"KgIwmYBRlpMGJBY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"aPf8G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"ko3C62vcl9Bev\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"AOaGCdOJHMgtJe5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"ClAmhk8yGcj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"fOGCfbp4v6mXWb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"icc85wIBW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"WSSDk9G2c4xT1d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"qqy7Ah1dI8DWR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"FkvX0ZOmQYM1zS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"K2IK0nwx4RK0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"CTd4oyJaRRN7Lge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"MQX083cHCIYxYDJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"I0vLtxrI1cN0eh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"EbNWfkK1O2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"QDd34cUX5W3yhm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"xIgmiilkGgz3wT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"w6H2S6CaGEI3Xdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"YdvdBchXgr5ewmF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"napkVIVeoVk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"WjwyexpyJNw2OIF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"JKDlzu1BS0PXwr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"CK6KhsFtTho1Wxm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"pItEc5UqUdc7kAo\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":65,\"item_id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":66,\"output_index\":1,\"item\":{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":67,\"response\":{\"id\":\"resp_68cd29071ef48195b32d320f9e34161c005b69872d9f3f55\",\"object\":\"response\",\"created_at\":1758275847,\"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_68cd29085da88195990348ba0c828820005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

            You look great today!

            \\\"]}]}\",\"call_id\":\"call_26xOE4JTbEFMhyeLzB8Xf4kN\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd2908a29c819581cef357897ca87b005b69872d9f3f55\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_5t0lGgx1knguZ3IYehA3YeeP\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":498,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":96,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":594},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json index ceeb55dc52..6ad8f67955 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_a5a4e168d1753fb5b8e7062282d0fa5a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"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\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015vjxuH1ovSf4FowyokbnZY\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll delete the first\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph for you.\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017Vzvr76KQukhQSxtsAHHWq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"dele\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":92} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0115gJcitQP6XWTotUEZY62p\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01UEy6Akwn3vJJukwn1tqKqx\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"delete\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":56} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json index 7a68b83644..b9a9152fc0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_f6a4f3a3dfe1a2fc35bc4375f2df63dd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnnzrpe39bhd9x91g6cwg2\"}}\n\ndata: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"fsq7rhvc2\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-9b3446ff-3f69-44e2-97ec-2d8357a6504e\",\"object\":\"chat.completion.chunk\",\"created\":1758274978,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnnzrpe39bhd9x91g6cwg2\",\"usage\":{\"queue_time\":0.12745234,\"prompt_tokens\":919,\"prompt_time\":0.259425421,\"completion_tokens\":23,\"completion_time\":0.062716465,\"total_tokens\":942,\"total_time\":0.322141886}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw1zpfxqvembrm82rks9z\"}}\n\ndata: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"h300af4gy\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw1zpfxqvembrm82rks9z\",\"usage\":{\"queue_time\":0.086932652,\"prompt_tokens\":935,\"prompt_time\":0.077367815,\"completion_tokens\":20,\"completion_time\":0.04542206,\"total_tokens\":955,\"total_time\":0.122789875}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json index 25a44214c5..aed8da5460 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YXTMAX4qCOuMdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"M9kanK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"CukqE4OapU68f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZDK97XuPh4kdCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ekjQZogVdvvn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8lIM8NdGJE30w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"trCmDu8zP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"c0a4DrsZK3Oxh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"q5PywcAJJPGv6j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"piHdzCmfQWWLq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"RR1tFlFZLiHAw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"OC1aLq24sFknQx3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"cafIVucmiYkyJtf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"kTizBpmaKgiV8X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WapZW3RliwerYF\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28139530819094b15132ae72d968024112aecdde177f\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68cd281308788190b0dd12e023d89cce024112aecdde177f\",\"object\":\"response\",\"created_at\":1758275603,\"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_68cd28139530819094b15132ae72d968024112aecdde177f\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":738},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tZakErfWbqfwVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"fskY6F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3tMGX8NZolRds\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"marGj22auwzron\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"2NcLHitnr7un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l45YqYKm0UjJ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"TBmY4fyNmU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nDb5bbnh2xWEq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4CH24OmgC2JVwE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eYO2EXprlVi7y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tPiCNjVQZ6Lbu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ZIT7O91XO0v1Dj3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QR0nwBHskrUeJD2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"IU0WpMo5tlNwSh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"M9M0YnMagXv951\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":738},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json new file mode 100644 index 0000000000..6704460a2e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"0EyqSdbLZNXEmM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"y2j7qe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"FbApPbBkjAaa5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ZZvodaU9xYcV7C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"ZCZyda4PMgWN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"0MIGRibWh1Eqp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"delete\",\"obfuscation\":\"3Ez9jk3ND2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VjXVVzTa2ArYl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"iV6xw5bXIcoMrb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iZBOquk1OMDGp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"U8PAGCdKKymh4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"j0NvxMHiB2OKyQf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"9LHLWDzLf3wcEdh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"dPg86gIrp5lLoW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"l2FzCRYQfRn9ti\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":20,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"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_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":675},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json deleted file mode 100644 index 186b7684a4..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_c69b87b4051b3dd8570a549150b9f62b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IyFbHFGl4j35Sr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"lCxWaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"NosJhyiRJtzVX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"x8V6xyEyqScLXA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"c0dCPPMfwoIA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EenRo958mOh39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"delete\",\"obfuscation\":\"0HBXyGxI3R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2OIJXSOLtCTOf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"dRsLEQpjf095zX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"t89o4kDRUIW3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"K0T0qGg7lNOUQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"xldVDEk5XbK15iA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"lJiFkopSwBgBJzg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"0EEdfn7KSaozJX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"MB9SRVo5gCRHtw\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":18,\"item_id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":20,\"response\":{\"id\":\"resp_68cd29029d6c8194a5102c42bf15f31f098e1b9f47118218\",\"object\":\"response\",\"created_at\":1758275842,\"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_68cd290371748194a32ddd4b09692da9098e1b9f47118218\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_qvGCPoEvWM2hSAaJVfBkPFhN\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":649,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":675},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json new file mode 100644 index 0000000000..f0aaa36470 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01T65bJ9rjoycDs5aXaK5t3q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_0167NZa6b4QCU1aHTG8eJd2K\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

            C\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"olored te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt\\\"},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Aligned t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext

            \"} }\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\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":121} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json similarity index 50% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json index 613c89f3fa..ebb16874b3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_16f3e9d6c39cf3530b93b0dc18e6f962.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"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\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_012kwcCVuvThgqQTxbhXKip6\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1262,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll help you change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the last paragraph to plain\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" text without any formatting. Let me\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" do that for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01ThEYbSzWp2Wc1VazTJBBDF\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hi, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! Bo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld the t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t. Lin\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k.

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1262,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":125} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TaoZy6LuG3nWuSfKQKtADC\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1263,\"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_018n3Y72hjArm4qKcDjrYpqf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"t\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef3$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

            Hi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld! Bo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"the text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". L\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ink.\"} }\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\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":87} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json index a35af00333..3e92bba2e8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f78e880f3984dc08d0d8eae19855fd25.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"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\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01GpNBK6yJkH41xJHw1iBeYU\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll remove\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" all formatting (styles, links, bol\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d text) from the last paragraph an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d turn it into plain text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01AKac4D2b8m9zA545VSfmNR\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f3$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d! Bol\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d text. \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Link.<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":126} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01GceHsF6X7aSzXJ5XRsVpCn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VoopGQC3Ahc7vVZXhxi5TE\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref3\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", world! Bol\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt. \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Link.\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":88} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json index f88522a8ba..d768ba62b0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_6ace4ed8b2a9de09f9cf76a4d1e1a069.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Ne6k1xysv6NAu6j12VzU1b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1098,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"Apples\\\" uppercase for\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HCokAvrBQtL99L79FFMvvB\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"block\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"APPLES

            \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1098,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":109} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Xo5KnxnxVE4SW2et2aYRWm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QoDHhiUupreXKMBifxMF61\",\"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\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"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\":\":\\\"\"}}\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\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

            APPLES\\\"}]}\"} }\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\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json similarity index 51% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json index f55953b726..686bf15278 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_f0cc603dc9a00de30b559775758297ca.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K8sRKBVbpLzHAPaLexVizb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph (which contains \\\"I need to buy:\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\") uppercase for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HqqL1GbBinL59vhXXDcKz4\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>I NEED\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" TO BUY:

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":121} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01H4xVSMuvqqVCVKieTPkxVe\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TnXnnHELUD2WLiX1rF2ktQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>I NEED TO \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"BUY:

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json new file mode 100644 index 0000000000..497dac6400 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01XubVKZvQ3R3B14pvkysDeZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":8,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01SMViYnhWUG75efC5NZ5LQ2\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

            Hello\"} }\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\":\"@J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":104} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json deleted file mode 100644 index 433a9d1afa..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_aa486140c2ee9c9c151278673ef5b534.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01PxF2P5jBgyJd2S3RPB7TvE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph to include a mention for\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" Jane Doe. Let me \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"do that for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Qo8m2oFT4Zeigcnqu1fgas\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, @\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Jane Doe<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span>!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":146} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json index 8804514328..29cd295f67 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3fa32c59b2292d1b9cb65fa4e45865c4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01G1oE18ZyNTd4zAzknos2ee\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the first\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" paragraph \\\"Hello, world!\\\" to German\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01UjMJtdv1o7DMzW1xtJgsai\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"b\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

            Ha\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, Welt!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":115} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Hs6a6XbM9dYs4iAUDx1Dd2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011bo2ddhyeoB3Qy8biiiLnF\",\"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\":\"{\\\"operation\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"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>H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo, We\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lt!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json new file mode 100644 index 0000000000..8fb45a14f6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CZqe2XcRP2MNTs6roeMsyE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Mr2ynnUwUWoPmUtt9ueb2Z\",\"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\":\"{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ohn Doe! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" doing? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"his \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blue!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":147} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json deleted file mode 100644 index aa35d86d8a..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_67b1aea5b2196920674bb67095939ff4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Nd7XpkvN158npkVMREZSsd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll remove\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the bold styling from the second block.\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" Based on your document, the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" second block has the ID \\\"ref2\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"$\\\" and contains the text \\\"How\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" are you doing?\\\" in\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" bold.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HPUtc7hsQeq4btgqcNZ4Uh\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

            He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@John Doe! How are \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"you doi\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ng? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"his text \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"is blue!

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":215} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json deleted file mode 100644 index 682c0dce9c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_9bf5b95f3f290ec3f15c4bfe53eef23a.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015qNp7sYXipKvoyyUorb1Br\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll change\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the text in the second paragraph to remove the mention of\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"@John Doe\\\" but keep the bold formatting\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" on \\\"How are you doing?\\\" and keep\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the blue text as well.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01AhJEqfMDkm5p7jqtqweXtA\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello! How \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"are\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" you doing?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rong> This \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt is blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/s\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pan><\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":191} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json new file mode 100644 index 0000000000..6710d2f87e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_018wNnFHJ8hJFD28tYnYL2es\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TRJScQ9jfvqNrv5s5TgLoa\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

            Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! How are \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"u do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ing? <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"span\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" sty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"color: rgb(\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"11, 110\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", 153\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");\\\\\\\" data\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"-style-typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e=\\\\\\\"te\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xtCo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lor\\\\\\\" d\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ata-value\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"=\\\\\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ue\\\\\\\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"data-editab\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\\\"\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":138} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json index 6a7b8e645f..f556a21003 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_442b81318d9a944cf8cc60b9bed7369e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Wx7TtSKN6fUSHFhUopmTKp\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update the content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" of the second block for you. Base\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d on the document structure, the second block has the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" ID \\\"ref2$\\\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QihApvzEvDPNaskPorfHNq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yp\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

            Hell\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ntent\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1253,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01A3HP3Rpdncrh9TRnpSUDZk\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01C71VFSqtWWSc9EDSmvyYmZ\",\"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\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tio\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ed content<\"} }\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\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json new file mode 100644 index 0000000000..2e8a211afa --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0128hRNbpfm3T3hRKZuWc9oZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01E5kmmUENV4kcQM3twtRXQa\",\"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\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"Hello, <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"span data-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"inline-con\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tent-type=\\\\\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"mentio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n\\\\\\\" data-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"user=\\\\\\\"Jan\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e Doe\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@Ja\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ne Doe! Ho\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"w a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"doing? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This text is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" blue!

            \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":165} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json deleted file mode 100644 index d8ab2b7096..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e2b88b585725be6ca65dcd553149b637.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CkZ6pKrRGqLsKvgh875fL6\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the mention from \\\"John Doe\\\"\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" to \\\"Jane Doe\\\" in the document.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" This mention appears in the secon\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d paragraph.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LDnj5oAhpBz8eyWXsMzTv3\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref2$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, @Jane\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Doe!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" How \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"are you do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ing?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/strong> \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext is blu\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":210} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json new file mode 100644 index 0000000000..2e090e2b13 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TnbZKBXSacGLso4f19br1A\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01YAiWAwScSWF4CrrPQtjqEC\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\"\"} }\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\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Hallo,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" @Jo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"hn Doe\"} }\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\":\" Wie geh\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t es \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dir? D\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ies\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Text ist\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" blau!

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":171} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json deleted file mode 100644 index 9a09784076..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_673f1e8de9e7cb18c81176e9cc11a8ff.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Mfhk9c7oyJxFZ3yebjUZBy\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the secon\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d block (which includes the greeting to\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" John Doe) to German,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" using \\\"dir\\\" instead of \\\"Ihnen\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\" for informal address.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TjjAGXhq76XuL9g5LjtbRA\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"all\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ohn Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Wie geht e\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s di\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r? Dieser T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t blau\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":221} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json similarity index 51% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json index 3fb19d1438..0b7a94bad1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_077d4831db306824aecba41d98936e33.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_011ZPjyh1jE921g5HJdxUERM\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph bold for you.\"}}\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nLooking at the document, the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" first paragraph is \\\"Hello, world!\\\" with\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the ID \\\"ref1$\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll update this paragraph to make it\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" bold.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NuHSh3BVqjcDR7aJPbi7um\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1242,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":144} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01LmRCUnBVwfhYryzTm9q19j\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PRnmEWxVqGwW5DPGV3KMBh\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

            <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rong>H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ello, wo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rld!

            \\\"\"} }\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\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json new file mode 100644 index 0000000000..d4f3e8d2d4 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01RV5tbqWDWmxQhU3vmp6J1g\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01T2Ariyp6YHfWQwMPMjWmEu\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json deleted file mode 100644 index 214419f7d3..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_beec7f3c8352ec01b4006cca21cddecd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_017dVr3Bt5eR2SQf4FHVTcig\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1250,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"world!\\\" bold in the first paragraph\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\". To do this, I need to update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first block by adding the `\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"` tags around the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"world!\\\" text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LQWTFtdqqx8aPjRr95v9Eb\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, worl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1250,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":141} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json new file mode 100644 index 0000000000..e0afcf4772 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01LC532PudHrVLg1kXzn9VfH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_018VPNup8jRbsc9xRssAzj7i\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"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\\\":\\\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hallo

            \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json deleted file mode 100644 index c60f13b84f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_8c7f6291076f8d78549724e1e2176d07.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0137YefMeYJCYkMvD7hZg9Yf\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1059,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":5,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll translate the selecte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"d text from English to German.\\n\\nThe selected text\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" is \\\"Hello\\\" and I'll translate it to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" German which would be \\\"Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PYVoakzwRnLZs1y4XEbHMz\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

            Hal\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1059,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":131} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json new file mode 100644 index 0000000000..aa8148ea8c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `

            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01JdzLd8DD8eXm6KUSS4Cfkj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01V9f5wY3LQvz5QFSg3tmZoY\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ration\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"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\":\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"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\":\"
              Apples\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"},{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"
            • B\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ananas<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json deleted file mode 100644 index 5b2a2a6029..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_e71b1d8d60f3f48fbf4965b5050098bd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_011aZ6J5w9AUwsbaT5qwcyqd\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":960,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll turn\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the selected items into a list by updating\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the existing blocks. This means converting\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" \\\"Apples\\\" and \\\"Bananas\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" from separate paragraphs into list items.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LFomkzMGaZDvEbgxy7kwtW\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"
              Apples<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"
          • Ba\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nanas
          • \\\"}]}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":960,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":181} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json new file mode 100644 index 0000000000..5a56275b05 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01L29NbnAst8tgrdgtkCKrjA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":14,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VtXvGar6qqJJtGq2Xuc2iJ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            Wha\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t's up,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":91} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json new file mode 100644 index 0000000000..037f0e8204 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01HYUKhkjBwpLFd6wUKDkSB3\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01565ChPuuVi822pmgchs6Fx\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

            \\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":89} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json similarity index 50% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json index 0c52c0bf0e..14cab7d625 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d3c3951246fca856a169f08af7ad3d3c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Lo4PTTvypcPL9wrK4MAwhL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1257,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph to make it a heading with\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the new content \\\"What's up, world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\\". \\n\\nThe first paragraph is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the block with id \\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" and currently contains \\\"Hello, world!\\\".\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" I'll update it to be\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" an h1 heading with your\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" requested text.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Je7Zh1ridtHQFRXrK98z6J\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\",\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

            What\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"'s up,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1257,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":164} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Hw4Zgyk7jLimsfwGfZ3JFq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HQ9zWquBvzjAUxAj1MJESW\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"What's up, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"world!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/h1>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json index 06700e46e2..09e9a76499 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_7d51b0559b55799e605d0ba8bd1c26e2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"auto\"},\"stream\":true}", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01FkC6xLfyFJTmyCmKh5tKPg\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"I'll make\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" the first paragraph (\\\"Hello, world!\\\")\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" into a heading for you.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PEBz6ojHyXg3L99xMJRnJk\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

            Hello,\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1244,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":117} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_013AjuPpfcAq6iLevQ1KbdxL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011WfWZ37XjFxEVtKdFmvcHC\",\"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\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tio\"} }\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\":\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

            \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ll\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, wor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld!

            \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":83} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json new file mode 100644 index 0000000000..8df3655b2d --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhbya3ee9tv82at7dh8bx3\"}}\n\ndata: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"dyjhtex04\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhbya3ee9tv82at7dh8bx3\",\"usage\":{\"queue_time\":0.086486201,\"prompt_tokens\":853,\"prompt_time\":0.072832573,\"completion_tokens\":53,\"completion_time\":0.110220643,\"total_tokens\":906,\"total_time\":0.183053216}},\"usage\":{\"queue_time\":0.086486201,\"prompt_tokens\":853,\"prompt_time\":0.072832573,\"completion_tokens\":53,\"completion_time\":0.110220643,\"total_tokens\":906,\"total_time\":0.183053216}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json index d9ec28ace5..0ef411b287 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_2caad518075665e79ed6e54db97f3ed3.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmscye1mr3wx121ad6697\"}}\n\ndata: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"dzjf29p3x\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c2fe10e3-9078-4953-b2f4-3051da3e954a\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmscye1mr3wx121ad6697\",\"usage\":{\"queue_time\":0.168786054,\"prompt_tokens\":938,\"prompt_time\":0.077529707,\"completion_tokens\":41,\"completion_time\":0.091263618,\"total_tokens\":979,\"total_time\":0.168793325}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw0fyebcr1pp9jyc2h90a\"}}\n\ndata: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"x1nk8fysq\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw0fyebcr1pp9jyc2h90a\",\"usage\":{\"queue_time\":0.144097222,\"prompt_tokens\":954,\"prompt_time\":0.07877144,\"completion_tokens\":38,\"completion_time\":0.074128877,\"total_tokens\":992,\"total_time\":0.152900317}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json index af13d21dbf..4dbd3f431f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_755a9ba6e33394d07bc82557aa46716a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmrz7fgcafa0ndq7n08yn\"}}\n\ndata: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"g5v02xv5z\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-120b8134-53cc-4474-81f6-7d99cf76733e\",\"object\":\"chat.completion.chunk\",\"created\":1758274938,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmrz7fgcafa0ndq7n08yn\",\"usage\":{\"queue_time\":0.198251366,\"prompt_tokens\":932,\"prompt_time\":0.078968295,\"completion_tokens\":43,\"completion_time\":0.104265947,\"total_tokens\":975,\"total_time\":0.183234242}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw00afxna0kgky7b3826b\"}}\n\ndata: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qq2jyc3hz\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw00afxna0kgky7b3826b\",\"usage\":{\"queue_time\":0.166709976,\"prompt_tokens\":948,\"prompt_time\":0.076982977,\"completion_tokens\":36,\"completion_time\":0.101701348,\"total_tokens\":984,\"total_time\":0.178684325}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json index 5f5dd661eb..ae8623622e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_e902977c579036dbb160ae0eca395ae2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmt6ce1ntvk1dw8b1thjg\"}}\n\ndata: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"htvchn6x3\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cfacc193-ba48-4ceb-b2e6-97f13f2707d2\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmt6ce1ntvk1dw8b1thjg\",\"usage\":{\"queue_time\":0.143378001,\"prompt_tokens\":797,\"prompt_time\":0.066661147,\"completion_tokens\":34,\"completion_time\":0.086528633,\"total_tokens\":831,\"total_time\":0.15318978}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw15zfxqbm26k2mzz4pxt\"}}\n\ndata: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"waxhp7yjk\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw15zfxqbm26k2mzz4pxt\",\"usage\":{\"queue_time\":0.166731611,\"prompt_tokens\":813,\"prompt_time\":0.066054562,\"completion_tokens\":31,\"completion_time\":0.071206716,\"total_tokens\":844,\"total_time\":0.137261278}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json index 3e6d2b0ca4..7d48f121bb 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1130f7a86a8f438a27e46fa58ae310d1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmy3ne1v8qw11g5qvwk2f\"}}\n\ndata: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"zhk4nz4da\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-468854a7-6d6a-460d-aeb9-cca76b5ead73\",\"object\":\"chat.completion.chunk\",\"created\":1758274943,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmy3ne1v8qw11g5qvwk2f\",\"usage\":{\"queue_time\":0.142714219,\"prompt_tokens\":799,\"prompt_time\":0.066927551,\"completion_tokens\":35,\"completion_time\":0.086290588,\"total_tokens\":834,\"total_time\":0.153218139}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw1jtebcskd1vcvqys2g9\"}}\n\ndata: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8fm5kzz3b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw1jtebcskd1vcvqys2g9\",\"usage\":{\"queue_time\":0.143857134,\"prompt_tokens\":815,\"prompt_time\":0.067731051,\"completion_tokens\":32,\"completion_time\":0.08735868,\"total_tokens\":847,\"total_time\":0.155089731}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json index b8c5603eb8..6234d3986c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_87e5668d7574f1c705fbf7850b9a97a9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmx54e1st66f6pckptc3g\"}}\n\ndata: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pmep4xgsa\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-09e480e6-3b15-45a0-9575-e20d9b3e8a41\",\"object\":\"chat.completion.chunk\",\"created\":1758274942,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmx54e1st66f6pckptc3g\",\"usage\":{\"queue_time\":0.14481466,\"prompt_tokens\":930,\"prompt_time\":0.07725131,\"completion_tokens\":54,\"completion_time\":0.113219367,\"total_tokens\":984,\"total_time\":0.190470677}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvz66fxjv95e1gkexrrp0\"}}\n\ndata: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0tdt7aw85\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvz66fxjv95e1gkexrrp0\",\"usage\":{\"queue_time\":0.16673624,\"prompt_tokens\":946,\"prompt_time\":0.076665564,\"completion_tokens\":51,\"completion_time\":0.091593556,\"total_tokens\":997,\"total_time\":0.16825912}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json similarity index 82% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json index e2d48f5b59..fc74fa800d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_303c0500fccb45f2eda1e4971926380e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmgnkfg0bez1y5p8e1vyf\"}}\n\ndata: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jppp67h93\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-df8f9c09-d960-4e37-821a-879a1c19eae1\",\"object\":\"chat.completion.chunk\",\"created\":1758274929,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmgnkfg0bez1y5p8e1vyf\",\"usage\":{\"queue_time\":0.122434484,\"prompt_tokens\":921,\"prompt_time\":0.086833867,\"completion_tokens\":39,\"completion_time\":0.105941953,\"total_tokens\":960,\"total_time\":0.19277582}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvtz0fx7a1aa8ej6qfwhb\"}}\n\ndata: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"p8z7r7qat\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvtz0fx7a1aa8ej6qfwhb\",\"usage\":{\"queue_time\":0.086775633,\"prompt_tokens\":937,\"prompt_time\":0.076552274,\"completion_tokens\":36,\"completion_time\":0.074209049,\"total_tokens\":973,\"total_time\":0.150761323}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json index 9b825acd46..715e677155 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_859bf6c1a4206efc6a89333473cf527a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1ynefesa5zfg3dxx5p73\"}}\n\ndata: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"bp2d0sq5k\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cdc4e6d2-2191-4bb8-97d6-35c8dc9ddf20\",\"object\":\"chat.completion.chunk\",\"created\":1758275370,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1ynefesa5zfg3dxx5p73\",\"usage\":{\"queue_time\":0.722134987,\"prompt_tokens\":923,\"prompt_time\":0.084956387,\"completion_tokens\":100,\"completion_time\":0.180736938,\"total_tokens\":1023,\"total_time\":0.265693325}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhh12behdrzhgct4gzcb34\"}}\n\ndata: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xz27agpnx\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhh12behdrzhgct4gzcb34\",\"usage\":{\"queue_time\":0.135983471,\"prompt_tokens\":939,\"prompt_time\":0.076725115,\"completion_tokens\":97,\"completion_time\":0.164452156,\"total_tokens\":1036,\"total_time\":0.241177271}},\"usage\":{\"queue_time\":0.135983471,\"prompt_tokens\":939,\"prompt_time\":0.076725115,\"completion_tokens\":97,\"completion_time\":0.164452156,\"total_tokens\":1036,\"total_time\":0.241177271}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json index 8c48765b22..7fa70920e0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_6e430beb6710f43b5e892c456ef287b7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1zpkfesv0hyb0c6n9xz0\"}}\n\ndata: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8hhnt9fbe\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-478c18f2-d958-4127-919f-f1fc2c457934\",\"object\":\"chat.completion.chunk\",\"created\":1758275371,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1zpkfesv0hyb0c6n9xz0\",\"usage\":{\"queue_time\":0.362030745,\"prompt_tokens\":939,\"prompt_time\":0.077815581,\"completion_tokens\":87,\"completion_time\":0.161374163,\"total_tokens\":1026,\"total_time\":0.239189744}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvxz5eb69pb2rdfc19py4\"}}\n\ndata: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"y95vgr1y5\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable;\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvxz5eb69pb2rdfc19py4\",\"usage\":{\"queue_time\":0.208335082,\"prompt_tokens\":955,\"prompt_time\":0.077725755,\"completion_tokens\":79,\"completion_time\":0.146208048,\"total_tokens\":1034,\"total_time\":0.223933803}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json index 7b61b70f6f..5a455758ef 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_74b402df3bb91868996faa9a1d58ae36.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp2skpffzs823b2g9d3ra0\"}}\n\ndata: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"4yw1j7en6\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8adf91b8-78f1-4641-8394-699c5da9a9e5\",\"object\":\"chat.completion.chunk\",\"created\":1758275397,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp2skpffzs823b2g9d3ra0\",\"usage\":{\"queue_time\":0.177781305,\"prompt_tokens\":929,\"prompt_time\":0.170193947,\"completion_tokens\":35,\"completion_time\":0.075324179,\"total_tokens\":964,\"total_time\":0.245518126}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvwbxeb4rwkpx70cbp1ys\"}}\n\ndata: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"vwxkv1vf0\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvwbxeb4rwkpx70cbp1ys\",\"usage\":{\"queue_time\":0.086807459,\"prompt_tokens\":945,\"prompt_time\":0.07606187,\"completion_tokens\":32,\"completion_time\":0.064029603,\"total_tokens\":977,\"total_time\":0.140091473}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json index 8e8690f17c..32cffa4284 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6459181dfa5f41379180ef90656d9e17.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp2pvcentsj3gqpb9159a1\"}}\n\ndata: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"39j7hppbb\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-34cf4583-21ba-4418-992f-63f499e6dec0\",\"object\":\"chat.completion.chunk\",\"created\":1758275394,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp2pvcentsj3gqpb9159a1\",\"usage\":{\"queue_time\":0.101258772,\"prompt_tokens\":921,\"prompt_time\":0.094021619,\"completion_tokens\":105,\"completion_time\":0.176930706,\"total_tokens\":1026,\"total_time\":0.270952325}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvzj9eba8h2205s84wa9n\"}}\n\ndata: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wr19gk2bj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvzj9eba8h2205s84wa9n\",\"usage\":{\"queue_time\":0.143051224,\"prompt_tokens\":937,\"prompt_time\":0.077586645,\"completion_tokens\":102,\"completion_time\":0.17471478,\"total_tokens\":1039,\"total_time\":0.252301425}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json index b4875fe11d..c52133bc6d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f98d47fe05796b5268dbe2a71a9bc870.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gp1y68e3ab0qkrgf40tn2d\"}}\n\ndata: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8j03kk7rj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-afdacaa9-b021-44cc-9a54-bcf3b5440b86\",\"object\":\"chat.completion.chunk\",\"created\":1758275369,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gp1y68e3ab0qkrgf40tn2d\",\"usage\":{\"queue_time\":0.095893479,\"prompt_tokens\":930,\"prompt_time\":0.075971487,\"completion_tokens\":108,\"completion_time\":0.233811516,\"total_tokens\":1038,\"total_time\":0.309783003}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvwnfeb4rsvbmt1prps0y\"}}\n\ndata: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"m9yzm6t3g\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvwnfeb4rsvbmt1prps0y\",\"usage\":{\"queue_time\":0.428420367,\"prompt_tokens\":946,\"prompt_time\":0.081082891,\"completion_tokens\":105,\"completion_time\":0.200575041,\"total_tokens\":1051,\"total_time\":0.281657932}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json index 91a4fc70ce..3817c9be44 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_a8802fc6c501e63117df4e9173995563.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmqh2e1f9ytj0ba1mcdvn\"}}\n\ndata: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"zq7yzk5kp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-980d1d0e-1fed-499d-bc15-4d6f18fcbd8b\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmqh2e1f9ytj0ba1mcdvn\",\"usage\":{\"queue_time\":0.198305943,\"prompt_tokens\":919,\"prompt_time\":0.077834103,\"completion_tokens\":38,\"completion_time\":0.102862555,\"total_tokens\":957,\"total_time\":0.180696658}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvysdeb983tgha9stmq1y\"}}\n\ndata: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jjdwhvd36\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvysdeb983tgha9stmq1y\",\"usage\":{\"queue_time\":0.084468027,\"prompt_tokens\":935,\"prompt_time\":0.077872485,\"completion_tokens\":35,\"completion_time\":0.096342441,\"total_tokens\":970,\"total_time\":0.174214926}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json similarity index 80% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json index cfc8c0564f..76dcda989b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_304ed4716f2500f45211aab067e7e2d6.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmq2jfg7sh4gpw3ta65w3\"}}\n\ndata: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qs9ktxdc7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1e7ddd62-b6df-40d9-99f1-70072e84e7a1\",\"object\":\"chat.completion.chunk\",\"created\":1758274936,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmq2jfg7sh4gpw3ta65w3\",\"usage\":{\"queue_time\":0.228763491,\"prompt_tokens\":926,\"prompt_time\":0.078450272,\"completion_tokens\":39,\"completion_time\":0.096219399,\"total_tokens\":965,\"total_time\":0.174669671}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvyemfxgb1m7ryhjmr6q3\"}}\n\ndata: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0wat0gmh4\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvyemfxgb1m7ryhjmr6q3\",\"usage\":{\"queue_time\":0.143436393,\"prompt_tokens\":942,\"prompt_time\":0.076689219,\"completion_tokens\":36,\"completion_time\":0.072927659,\"total_tokens\":978,\"total_time\":0.149616878}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json index 0407fe073e..058548c8df 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1499e8407f779455394b30013d5582ae.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmh42e1c9k2x0c0hr749z\"}}\n\ndata: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"d16tqea99\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-84669905-4400-451b-ac04-c086ded7d465\",\"object\":\"chat.completion.chunk\",\"created\":1758274931,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmh42e1c9k2x0c0hr749z\",\"usage\":{\"queue_time\":1.7217411070000002,\"prompt_tokens\":751,\"prompt_time\":0.064931841,\"completion_tokens\":37,\"completion_time\":0.090980096,\"total_tokens\":788,\"total_time\":0.155911937}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvv9beb3amje89x40971x\"}}\n\ndata: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"f78rx5sng\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvv9beb3amje89x40971x\",\"usage\":{\"queue_time\":0.084479472,\"prompt_tokens\":767,\"prompt_time\":0.06452397,\"completion_tokens\":34,\"completion_time\":0.083579414,\"total_tokens\":801,\"total_time\":0.148103384}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json index 9a946da907..fe8dde0566 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d57317519f06e1677e4061f027456024.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmss6evvvm7mk1fsq4raq\"}}\n\ndata: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"w97cg643e\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1ec4e601-c8f8-4bd1-933c-48dcd784a62a\",\"object\":\"chat.completion.chunk\",\"created\":1758274939,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmss6evvvm7mk1fsq4raq\",\"usage\":{\"queue_time\":0.168483433,\"prompt_tokens\":671,\"prompt_time\":0.054854807,\"completion_tokens\":63,\"completion_time\":0.136827403,\"total_tokens\":734,\"total_time\":0.19168221}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw0txebcrhvakz9d3ejdk\"}}\n\ndata: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wk87fy1rt\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw0txebcrhvakz9d3ejdk\",\"usage\":{\"queue_time\":0.084589358,\"prompt_tokens\":687,\"prompt_time\":0.056308459,\"completion_tokens\":60,\"completion_time\":0.114429398,\"total_tokens\":747,\"total_time\":0.170737857}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json new file mode 100644 index 0000000000..9757cd48ce --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhgd5gex0b78ffagwb2bqk\"}}\n\ndata: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"k767zwyv7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhgd5gex0b78ffagwb2bqk\",\"usage\":{\"queue_time\":0.087851709,\"prompt_tokens\":949,\"prompt_time\":0.076126094,\"completion_tokens\":40,\"completion_time\":0.090098744,\"total_tokens\":989,\"total_time\":0.166224838}},\"usage\":{\"queue_time\":0.087851709,\"prompt_tokens\":949,\"prompt_time\":0.076126094,\"completion_tokens\":40,\"completion_time\":0.090098744,\"total_tokens\":989,\"total_time\":0.166224838}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json new file mode 100644 index 0000000000..943dd6bf7b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "data: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhbxd4es19cj54f79gzbh4\"}}\n\ndata: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b65g7fkd0\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhbxd4es19cj54f79gzbh4\",\"usage\":{\"queue_time\":0.136485163,\"prompt_tokens\":937,\"prompt_time\":0.076527714,\"completion_tokens\":42,\"completion_time\":0.082351693,\"total_tokens\":979,\"total_time\":0.158879407}},\"usage\":{\"queue_time\":0.136485163,\"prompt_tokens\":937,\"prompt_time\":0.076527714,\"completion_tokens\":42,\"completion_time\":0.082351693,\"total_tokens\":979,\"total_time\":0.158879407}}\n\ndata: [DONE]\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json index 3a8faf736f..1d05d1c507 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_4b19753f26090bfc459e8d1ccb1d0e7c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmkfke1e9er7bbmykrgq4\"}}\n\ndata: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z8xk2ygca\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4a9eb15a-e356-4a21-97f8-437424ee27d6\",\"object\":\"chat.completion.chunk\",\"created\":1758274933,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmkfke1e9er7bbmykrgq4\",\"usage\":{\"queue_time\":0.874671625,\"prompt_tokens\":933,\"prompt_time\":0.100309995,\"completion_tokens\":39,\"completion_time\":0.096549883,\"total_tokens\":972,\"total_time\":0.196859878}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvw03eb38m8cv9tnnds18\"}}\n\ndata: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"edpf98tj2\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvw03eb38m8cv9tnnds18\",\"usage\":{\"queue_time\":0.089876329,\"prompt_tokens\":949,\"prompt_time\":0.078248716,\"completion_tokens\":36,\"completion_time\":0.08635079,\"total_tokens\":985,\"total_time\":0.164599506}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json index 85ca94d276..84c38cdbbb 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0700e190f22707c2b2c2f3d1edce5a21.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json @@ -2,14 +2,14 @@ "request": { "method": "POST", "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"auto\",\"stream\":true}", + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] }, "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5gnmk1efg2r9pt2gs09tv43\"}}\n\ndata: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cwcd2x28z\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-070c7085-8699-4f47-9021-924988ebd2fb\",\"object\":\"chat.completion.chunk\",\"created\":1758274932,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4134dbb0b1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5gnmk1efg2r9pt2gs09tv43\",\"usage\":{\"queue_time\":0.197800641,\"prompt_tokens\":921,\"prompt_time\":0.07672189,\"completion_tokens\":36,\"completion_time\":0.1052973,\"total_tokens\":957,\"total_time\":0.18201919}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvvjxeb3bdvfznd9nqs9z\"}}\n\ndata: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qbmv8z23g\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvvjxeb3bdvfznd9nqs9z\",\"usage\":{\"queue_time\":0.143733727,\"prompt_tokens\":937,\"prompt_time\":0.07726139,\"completion_tokens\":33,\"completion_time\":0.091185592,\"total_tokens\":970,\"total_time\":0.168446982}}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json new file mode 100644 index 0000000000..296ae9e766 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5uLsBt8WOkxbw7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0ZhCO9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"6z34bNaVLbsQk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uuAF4wAlT9JjuY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Btq96bxr8W6D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3Pjgzk1Gu24U9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0J3Uxok5Ec\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PO1pnoWVzc2ja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"uuB8z8MLRcGiWY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"I5dkbfkYGE5b9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LUcuk2j6r7zhD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KYfNe29NiIqmIuA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"kzxiBTblv9Xp8iV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iPlRakbLsWOpP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9KE3JQLaCTz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ITuEAGNCVBKXr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uFLkof4Oh9y4jQr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"0SrTaKhIzerazZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"EXIqMntHigjaJmx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Colored\",\"logprobs\":[],\"obfuscation\":\"6AgRvDmsf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"tVDyXDuNXUv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"lWBLDo0AdY9UVe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"wwOMhrljaTsg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"6Jo2qDSKXebH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GP5W9o215SzRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"SiUmkftrrp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UNonMn6mSuSIu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WqhewL2YuSGxHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9wUklSPPRGolC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kTQg2W7qLEYnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ChKAoagb19ifyB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3PngERGmC4RywQV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aSLt89EVgfS6G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"g7b2OWs3jAu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8duvzkAZb7Sdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kecHfMwHfnrpX0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Bc05cgBYon3cEum\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"LdVvyGIFLMQD33E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Aligned\",\"logprobs\":[],\"obfuscation\":\"dCPpQPcb8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"TOtdGNfcIpJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"sBF1mbQZoN5gUAx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GWHEGqBADFe1V7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bp1HXxia7s4Ikb\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":52,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":639,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json index 5f259dba86..43145975bf 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5br5WkIzKx07p2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"zw6W89\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"mfcKrLx2AkMpF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"RgKh7kqmcNInJf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"zc3S9ek6MGWa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KEqvW1CWZWjgc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ph49O1L0pn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"T9zPdr5XDMFIb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"M5hscfYUnUVVlX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OOfQPaGDYvEz1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"F156IMkISVtrE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"JDj6z87msc8xMTp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"206Mju7lGB7Y9kp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GYOEnIveSAecW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ameUHo8oO2T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hR0mRlh4EYdOQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"ExUsnLD4jL1fm50\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xHiidG4PJvP7Zxd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"RyJNC9w45TP4Pd2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"LyYOaYtJmge68a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"NB91byS6AZofkd7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"0ok3sbZCMk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"tSw0EfwGhvfaj5k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"zS0zQK1GvsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"CM4xikhCQOhB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"eXpY0FmRPFl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"sLVt8MS4LqVRbOX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"bTaBYQIjz3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"hvWUSCSwOFlIUjn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"u35afBz9u1uNxf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"iMopgsimZqotFs\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68cd280cf20881959c8adc9fe20128cf0a33c87be8b47c82\",\"object\":\"response\",\"created_at\":1758275597,\"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_68cd280d82348195b00d7edc5c28f8d80a33c87be8b47c82\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ArGQGIf9DtGvGO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"bIqGFi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"WtTjLt3ctKvmw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vPZYS0tKgx6h3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"t8Crcf41yM2R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kn0mP2hQzWvK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"SiM2iufR8k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pRJxi171aXiAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4XM4SFqAcosaMw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"L6vbyNmoEc4aS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WgiaqvyQtDBWW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"iO20vXZfzS5O5ZM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rB6iuZ2J8K30DZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Vw7vYFRgmYidF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"995idUyX8sq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NwQ1otrpD7cva\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RQhkaKDT7ncdZBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Ubwg5fplxp990yy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2QFva7WrGvEqbRV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"j79UzHsdccvuZa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"mn4InWuhgFRhcYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"nxBsumkEca\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"LTAP5xtZKPmlbNj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"uqOpYZpVHQI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"8TPlPkVNg2oc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"PwQ1cJx1WG0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"9uvUqO80hdYoz1p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"TnjWdsSGM3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"kVs7sxE4bFvZgqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1a9umI9Xx9jURI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RgUOdPIMNehB39\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json index b9507b263f..5101a1cd1e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"nUmOrevqGS4QXd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TZyM5s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"eQ8qlytBhKc3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hQG21buVHNdJ8O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"k3b5kVkM4gIu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ytueO79lRqqd1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wBKOkHs5RB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Jrsg0BNU3PZLG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1C5IXclJKMk0en\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CxfOWm0zOGJm9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TRNciwuNQL3mU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"OdbWKlptuM7xVXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zCVG8VIbw0u7fOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2GYlq1DFn9UqK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"TiMngKlTJwv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"P0j4Yx8Te9Mxw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"t6MRpYaJqqlv5pm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"r3TnZ3TMrgqS3uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"fQDKJlji7z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9HtMgqq9Ot3dzOO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"pojUxMWvms\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"gcLKIB8IqOLfwVf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"JWo43FuIOwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"TDUf2uBO7Oa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6XzbsOrZ8R7em6A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"N6cxEZU2elR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"CosgvHEoOlWwLsx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"siALsHVrm7zjBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ZTbVYSjG5SRosR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd280b19c48197a1b365651debc42b035fa7c76add19da\",\"object\":\"response\",\"created_at\":1758275595,\"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_68cd280b966081979d04ed99d1074ee9035fa7c76add19da\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XPJab5zLSUIEeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"m2IW4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"KJFxUWAUzU7pJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Az8pSw205uGbXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HZhSe4J3GFri\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oNlDTPm4gQm1p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"2KRP41NAZS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gZeTjF3UEJFjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"BhvsDkovXDdDk3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GCO4EjzrHK5cg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"pLX78FYG8aRim\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"fSQWvSs5QHrmaYP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nHpjf48NMO5EorH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uBPIhr20viL90\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"m18mxGywiA0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3je9Q94gA6fJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kgeIQkLcovzjxLs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fWvUnrszKV5UUeG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"yEjut31BWR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"EKtVRxtilT4NZBc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"KVnyiycTvV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Ii4jQWEwmltgqVl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"c5WMeRkMEgp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"LQAAF83Wi7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"VuJnNSI2M5WOvNX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"OTAT8a55Mbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"2YB1zDgs9qYjHcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"p21cho4wscpfn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uGy658YnvnaVL1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json index c84a6621c4..453fc512ff 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tddu3EBaHb72gB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"yv5BL0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"49U2gd32Merbx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8S4xGBNT6fHzzY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"lo08fKFMAzsH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SmSa9iiS1zvUC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"rkX2HG7adf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PnLFA11QKcUhM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"g0XUYpA62FNk7f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"muGmkHx42Wkzu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"zHRM4pU23x83w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"OcZbQj0fHSzlOYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HQX7AVHCsAqVaYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5zY3DMrQPM1rg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"JMltvpYEgEY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w5qSxhy3e0cIo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"O9OfP68VRTVVE0V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"BXDhWqyt8C3JuKR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"DMPvry7zol5Dt8s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"OXSOedcD70cXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"gzHXptXMZeySo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"IsQ83VXdrxX9Frm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2zpxLr1sOtdeD8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jnFVfdWBsDhR1T\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cd28100664819587bce8b73524a93f0e1c96b133ab686d\",\"object\":\"response\",\"created_at\":1758275600,\"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_68cd2810a6f88195be2dd1f8c6e0a0fe0e1c96b133ab686d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TT8N2yVLtNTic1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"91Z8P3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"435HOS4EUQ5gi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BzdMaaX6sVIkGJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pEHKihYhNXW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o6rIymz8J75Vo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ICvTupVbJV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"A9H5csFonLXf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"dgrjvYsnANkpRj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gelkaohmmxfTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WB3WsyqBFBxdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Nv07Nd5rKbuWvJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ATgsENTkL37jKoD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hqQ57C4DDHHDN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"wnpkkdvHGWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o9FIQ7FgX5cip\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rEUNHbqPADntwDK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tB5GiQeXCuuAVxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"pCH5yJlbiroILlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"7ADpLi6vW6x3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"LQKsPbDuDFJYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"XqnKJbbLTyssiz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"s4zV1wd3ahOsNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"BBFGSUUibXKLQW\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json index 4c4e2d4e2e..3d436c85e0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qVqFk0v9a4GAHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"wqkdcM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"To7p1nLks25U5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"it7MOsrX78EnMC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gHu0L04K662X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HDVck47T62U6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CFUTQeMGQ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ri0iEfigNeN89\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"MAkty6aRfSiiGQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o20Cb1xq5dz34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3zYRb2IKOCB7M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Y5KMAfJhOcms69P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"oHyAnhsUHoRFszE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nB7qCqcatvRCe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"ReztnpT53Ag\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vCGoF2ACRQGEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VKXZnPJJ7QTtFOS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rhhmX7DCo8HMzgc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"dM3wklORiBqYNd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"a9ECZJpuaR1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"amGWVIP50ZBfS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"SMCMp7RhMdVv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"hJZmES86Y9ZzOrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sFhJrYOCuJmIme\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QVGiGQJNnIAtqu\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd2811391c8196a6202c4433c53a800ae0626af18e3953\",\"object\":\"response\",\"created_at\":1758275601,\"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_68cd2811c3248196b0d96c9accd908a90ae0626af18e3953\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"eQSYFUkvRYwgJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"QOU4pJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"560kj20H4b9PA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gggULW6nZEjpns\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DEXM9hy4l8PT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7WGVzlYnHz5ob\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"EFMo9JuLg8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"EEstUvBpWDhn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"JHRcRp9I9MROJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"voyt3xMXG6J4E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tu12hPI8jK2wR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lNu8hfASBXtuqNh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ASYBM1UiOyrmsJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Kbb4nyg0aDPQS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"DmEVpej8G0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zRQM9gSmV9kqB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"x9V4MHDXfLAqi1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"qHbIIPU5uHcokqs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"VaTbf8Ab4mpzn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"s2fqK7Oh5Fl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"acYDaQfleKzWl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"kyR4ZIsfqJQ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"SC2DFXbTzAtRAWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"tL79pEXnWzsVkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"gDnZeUf7EK2MMk\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json index 5be87eb1b4..c8e28ca8b5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cPQpnFtm4oSCD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"dAm98h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"QMzGvNGIa4RLi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"I5WpLFAfixXPyB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"GNY4hDiJCrYV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"abLVpqkqPSpou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"6TbNlXksXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Icz3KxmuxqbVT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"lkSvbSVBz6SQfD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yNksGwpdzl1g0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KwTWNJseUV16d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"WfB0k3rWDvhphr9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HIgHxCa8GFIt3tk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Lvk3COevzj2dt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"aBlrFXH6zth\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OhHcd5dgf1WWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"8BDMlc05YFHjSn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"QmxIke1YuZxv37O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"to59TQZLy1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"J12S1yy3Mzyicc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"E6omujqjrUxuTJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"RemWfSxiq9QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Az4TWERl6TD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"l6qwH0WPy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"Uq4wTCoL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"4F0iXT5lHBf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"aoCNnWgcl8nrH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"nUOP9Exxz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mXhZqnvYjMTGNW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2Vn9lPeUTlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"957WOFQvRD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"MNXf8vCFnvtuQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"I7EZ9DYa4qlU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"ftKU3h05J6Ns\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2O9vj4lTH2ogW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"9yijOBAC04IpQvE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"e3lI4P95lFUz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"xIQCR24VcDZm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"X5rTTKrdlwkhEM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"5ZcZWY2uYfbT1Im\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"moYHX3WDknvfNZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"tB4UgvfqsSQ5fy\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68cd28081dc4819090153168ad852bac0c86c3a984596b79\",\"object\":\"response\",\"created_at\":1758275592,\"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_68cd28088db48190a4c34c206a84efa30c86c3a984596b79\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"B3nTBmKGerx6jB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sM1mpQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"v2POz75iV4RsI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fdaqe8PYxxWVOV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"je5hNjr2xseZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"n10qppaCXXUdT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ec5lg1sOe4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i0tCn2A1YSrm6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7DgyCTHFnFCCCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QWGTvLbozFOG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"1rNrn38d807Uy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KJ2K0xsC6ffg07U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"tbOh3QjxTbwy3K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KKh0TlZV98gkz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"lCtnBPgWNKp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EmRiF4Kqmada1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"17DNQZQFVqRE1b9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"mPXpF4PqZHFhB0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"qjw4XD1tBp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ztO7Tim6qzRfAzl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"gn0rjc70uVaJdR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"JkFktUgeys8x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"0mxXtghoEDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"vvsUgI3lk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"WvANn9Ot\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"P75xHSAas0h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q5g2T1WkGb8sY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"8yUXZpX4S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"AKLy4iSKBEFViV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"z2tvRmoH0FX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"ZFjGJeCBSwU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"g6cHOMrJYOqlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"ooiOftpAsC3t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"2bujtJhCcwRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"xfTeMB4cAQ51N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"990mbyqMrBs86Qq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"TuriptfEAY5r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"0XJClzbhc3wP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Ef8R50zNw0JMRh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"hMzjHVl3NwyyxR5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"X6q9HtNxj3ybLn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JQn82A6ay5Bl6s\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json index 9290061525..684aa393ff 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Xf8hiCB01LgE44\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"n50bZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0FaHO2IfUcbpS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"zbpkbdBFMfIikQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"KcIvXTzqc0b2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yxhfmmSjk0Mzn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"bsEPpQRKiL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"So5mv4vVkrfAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"1tfFp48pFVYuEV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OTmjLZACqOKAg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"jF3lM7XKZko2B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"8DbhE4PaudwJgNP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Jhl0IxhAKpkP38i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4Spndo3YphIKa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"QK5VwiDTE5e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"B01PGHqViqu9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"4Ps7H5oEMWrwSqj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"8wnmOfWm7XYc83f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gAfsD18zrw4GRjM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"zdunylHFA27\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"59syhlJO057eyoN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"M51tIYXg2PS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KiVCGJhREWJCEcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9DJeXfe39udcac\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"SMrhbnIaCqrDPJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd27f887d08193b58acbdc63216b6e0ffc617b9fffa85a\",\"object\":\"response\",\"created_at\":1758275576,\"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_68cd27f922a881938e4158cbb18606c90ffc617b9fffa85a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qSS3qOGUgKIxz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"FuBXxi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SWJnVnfFzA4uW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XnpmVgjtVYm8nf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"n51zNxVrMPE1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kfekf7P1MYDYB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"kWARpWhkyC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pAMJkI1oscY4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0BM6qYzbqYek3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zgnVEjiUs8Nzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9nqXs0OdCMwXM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"OAJz7OgrigI1NaL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Omhvb1wAGK2ajsZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"89hZaa40THDZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MBYt7RmOSQw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KB7VuY1DOdKCW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"gmK8viViIZN9cqw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SALr4K0UbTpE5VI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"lQqv8KNy2eorYbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"YttfRbzUoNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"YesFsZoduxLEEUG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"1ESeSsbhMOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KgGDWyYAnQ1xvDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GMYwQsxgEYk0Eb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"rMMpNUvyBKghF4\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json index 9acf101931..f9f5e01cd2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VtGYtKusL1M5lv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"6cGOp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"naW2l2uCL6Jht\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4zZM87kzOOrH05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"u9ypwwP2qIeL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"N2L28zI01GroM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"8yrOoVyGKC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GOsu5ZuErg8gm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"KcERKSSoVtkwRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qCHAI3LxIK8CX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"brJFRcCqZ7ViH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"DE1N5xYSfJJVbM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"lNlaeyiuxmIRllM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"1aztDuzpIE9Te\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SzThOU4NNwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nnOOUym7Z5JuS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"zkiQ1erHuGunaOE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"IUubfFuJNMkFU3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zCwKwlqguB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"4vpbFeL7IZ6KH66\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"6Uymn4iEXaHyar\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"ENWGYPOaWrql\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ztj8HQag6vw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"Wv8YnGAeS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"vZKsLMaF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"lsz2JvxWWWy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"J0ylMKxzAfniH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"ew9EuyT7b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mGiSaTXuoIBqQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UkKPcjMUabS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"D7jQ0YKidau\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"oLjfjSezWHe21\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"FfXMmPCZTHvW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"bxIic8FPkUZY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"m3IGOPB5I8pq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"q0xn7cLpXHbOHtj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"SjW8fgBnGZC5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"Aj4vXhm1AmZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"dzDRLNY5rjcPk2g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vPtCiby0UyuLXvs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"CNc6HuDfOT0s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"Nfsio3HLQzdl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"5l5fOBMGJVXh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"eSfRckqdgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"tmdRNZN48ivcGaO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"5MV8bFtQid0BmH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Eta5VqPVR1j3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"mpSmq24dit\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Tt7KgGxJRTMlP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"5V8V8Pavgnk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"7tlK9yyWKJLKz9y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"fcMhpKPQXo3A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"oVPaIQNXDt0cfaQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"iMgxNC5DAjvyRz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"8MoU5dOcfILx7qW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"gdoU7pVYAXx4zf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"miRIpNkZaubGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jQDBRIyWWSV8fhN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"JPCPVJeIywuxdXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"jGLnLKkIgF5dX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"PIiFI4WpJVN7a1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TkwVaJ0sbIhldH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ojBCEg6H5R9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"LE67Y0FkSn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"lIgMOCQiCo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"RzzsrL3E9yCvX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"obIaiCXB2Qjt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"kEQweUAaDbY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"u22Tg66l57DY8N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"35TN1VFs88t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"oivxtWuFbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZDoy1TvTKaQxX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"oZOuBElUn0qQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"x83l70SpBPwFUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"7nYSyfr91SL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"MPc1zA9I97w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"Za6CeTvWV7kC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"WVPCXrt7qgHTS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"xgn1qrsL0vPbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"NYgRW2dTlQeN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"jiELK1tAje1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"hEcpWdn3IK76n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"KecZeyd45Su\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"LR92Ic989ZsgllL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"sfL2FMtYkbVT2x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"FnVslwIQSlybTA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68cd2800e2cc81969598dc89359fda820473a762ae8bd0a5\",\"object\":\"response\",\"created_at\":1758275584,\"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_68cd280165588196b4395ec371272c6a0473a762ae8bd0a5\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"b76fRgtxcDZoqJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"LwsBS0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iSTU3f2ivWmAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gE9i88pdwZS1Rb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yB7a4Hz5l52y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ty62tkyZu5I5w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"lawmvSRhUP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"K9cF8y8JS8DvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"wqQ6iWEVIntqzj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"aExShaBjMPFB8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"MahcIhp6k02Bl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"XV5L9QXtw2xJ3oX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"PkEMuT6dS4s7hay\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aR42pbtH7xncx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"8d8gwvaMjYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PSPR4xjOs6hbO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GQMdbWZwGTUFzLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"kZa0ybq93oMoAIz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"fWmciII2iX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BRU2Gi5dAigVY90\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"CcogqYxmMrBSkJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3QQZdk2fz8nh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"h7uIAfQ69xC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"ypo4HOxp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7QZ6fEys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"m3kLaf8RNUd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"jZZ8kWIdBMk3I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"MUhIZOaHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5wRXmB9RQ9AUBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"g1ZsCR1B1ZF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"g6jh7ST8n5B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tISk4AWxw6CLX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"WAD0Jjz8tzSJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"EsRIdNenMF5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"py3IhaZtUfPbF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"cDcWuaXgufayrhf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"7uNsfTJM4xGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"jprUIudXQpkb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"p1RmVRthC6poPVC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"BXcdphvxTFcUCo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"i5veTUA3sVV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"01B9DF5FBvCX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"81K1tb5AHWEr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"1n5Zrc3V88\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"nMPUpMqWhReVOZf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MrOouTAW7tPcam\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"yh5JKseRUcow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"HwMNB8BbHO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"O9Vlg8EJZhtyS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"5VMLyB87PGx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"XIoT53R0nbzN65n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"rCvy9l4flB3z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"qieS5U90PKo8MuL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"nr5rUXtXgpqEjJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"qcBXdVtz6ysRlG7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"OhO4idlS13PyEx1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"LHeAzFOfcltai\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vH6oemFxt00lECe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"c9xKeXiLXEh4IM6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"vVgHixfYYdxiZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"p0MHAAZOTptESj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KYEE7Sm3gY0mm7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X1gKuvvH167\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"ma4P5hIxAl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"po5rTCHjZSc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"qBpf5g1NoYkDt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"hzcPvjQlkd5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"G9rx85FfsuI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"g2Jsf9XQBDT8j6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"js2mDmOuJC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"MIpLw9JIP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"L6cz7PqrCcYjD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"ibpT6PcxgDY5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"iBNu1UFebeANgy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"nYkEg6gMdut\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"B89Sa1engkf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"qLIqA4DLHULH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"s7cg35s4G3jsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"OeijihqHF3KVK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"hV3ewZHDPYG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"kbcgF2OhjwC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"BNA7oFWO5A1K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"UlBhfwlV422\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VYxvl1QwSSutmCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"nf5EoNK1FIb3Nb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"pYp2Q74c5asGxj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json index b0fd628158..ddea68c319 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"z0h3rlTX7pwE5a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"kvdQrt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"T5hWThivI5Z8U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"QiFHdaEF0WEOvV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"O3pobqWurxbp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ktHvD88Idkc0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Q4Wz0oqdP0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7Ri1rJrfaj5t5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"XE8OMZZFtnV2no\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mKXOTWkT36l4H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bOshPjIMrN0ri\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"B9PCr5gYOZQK6yb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"em28q6CW5qh6I83\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jGjLqFnXnRiP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"a9Gzt49Ceq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3RGrNU2ZstnxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"yPJZb5f063QH2Ra\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"rRWo45eqDZ1ukBd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"GYpQC28idE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0jh4irtd2dRznCE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"tDtT0TWTThCYyL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"EniAOKAXTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eQ0FdJy728VJjNp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"fxlBAA1zeYCRl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"fzMwov7AOvdX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"AZHSv7UpSE6w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"db8twOkxiE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"8oSykUPpP2DZ65v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MvudE5T6NuYuOc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"VFrh0pXmdnmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"O8gpWEsEkg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gSNVyhGPNQXt6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"WkAhPKXmHsX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"Y5KhSGGEdXJ5Lbi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"uO0h5fNhdp09\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"QUAvVf6cCRdCRof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"9LV9IOa8XB55iR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"X6QCJw2jjXKxPmK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"wX9HY9i2KA2jM6i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"b1T4CPDeyZnKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"8A1MpO4UnA2Av8f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"BUrVp8Za42RGGJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"IPONqPu3Wybzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"WVAPUGcpo85Geg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"o6Nr7OpGDX4g7b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"rKnXvahITVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"F8wSB3x0Li\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"XJqjuXNrKuz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"xas5z10coavDL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"CL7XZLfBPBg2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"ckwWVYi6FGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"BeOsFytZ3vTejV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NHxZCctld40\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"Px4CPSMdsQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2lZBkNjGvRZG9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"94yKcru27tKy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TzhUq7Lmbr6SGK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Ip6pmK3iMnX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"5B09OHAvzc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"LQzsUbMUVpKd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"chkFUSyrI13LK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"u6X2jCIKGp9FD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"lBKUEUZRIzQ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"EOrRI6N43bM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"9W3GFAFuw1LbT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"MXMBorgLde5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"7lkRv4eE43KeyeM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WYHG85KrKnVzwp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3d5tLRl1d3K51T\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68cd28025d3081979f45e56a788f540608c2a9d82b319682\",\"object\":\"response\",\"created_at\":1758275586,\"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_68cd2802f9648197b65015101b8e298008c2a9d82b319682\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Sw7JYSs8yAPW6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"3DRug3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"pmhMD90ClxVgX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"jfwkAHeY1r7euR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"vw5LGI2k6lGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"bK9NBSz5pxkjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"v0rUh8uolO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sv8X7pYUScZOR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"fcKlYOtggbXPGC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"W3yWQTOyuohF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"RBPe5MAV1J3C7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"NxC14gr6CbjTmjM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pkIuIijOLmWezt2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HvzuZNkQoAJov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"stDsrwMRHqA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"bEokXG52gC7du\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"MuM5VYJVYnj5CYn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FTu74cSNnlzZWFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"oCwMM8NVLv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jW1fWc5huLi7WFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"5GlF0SUEAgIT9x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"0FqEzMl3zS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Glwxt8MhsUeGGnE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"4LgQst9UvPA7j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"7fn1nU7Ad7G3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"qG3hCdZr0sSw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"SCJ5UblWj6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"BbvOiay4PlVOSzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"TSYBsFmQGO0Y20\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"XvvD3xypG705\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"lTT6leJ0gT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mlpegkiAUw57H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"eHbitlbqJc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"SHH1g1hIFmG2F9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"gvYs615bN5xF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"1jlmClmNicL6cux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"CDEjYVdiBtfroJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ZNvoeZfdTwbnaic\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"lvVZk9wBxZpUiyI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"LsPBDkpgtgjfy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"tWyP384E9kQ7ZYt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"XvAY7fze2ORlEC6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Qs04lxqEDTKWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"eiGiSQuEFzF3gi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NtMPv7mvD2Tsqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JHmRgUM34qg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"q2ZNGhlnsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"tkbSCuYjWTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PS9XX3uCOqgWO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"hQyvVmU6VYUU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"JJ2ojQnmVRD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"94xWofbe4SJK3x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4dYQLMD2utD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"5nmTXB7chr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mAjGhRn2hv5C4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"ZRhvyavBB8oi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"oyni9K2Z0XDMb4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2GoExxl652K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"Fv7QPCihWiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"neQ5omiyAPeB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"dpAmlvRQU5fGA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"R8kbMznHoeWMv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"vA4e7RLhQKJJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"DNpSjhozx9l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"bCn4Cao9FBN11\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"3JkXC7RwPYL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"kIDz9JYXgG1UzIR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"LP8vyTQi8Dd3fZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"m5rt08SbTMaaTJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json index 5d4e4fbed3..181d894a1a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"eC2xAIzKwuIdv0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Em9Pcy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"auskRZpCjFi69\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tkTp7LPSsb6UD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"59950msxk20y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"4X2TXBKWHIQoP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"L3aEgH6j2V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i9OBSncN261kT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bJR3mvEgxIuObB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EhoT445CW6yZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tEOJugdW19KLA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"aH39A9PC5SLwnU4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"LwGIYn3lhLiYjRA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Dn4KjVqdlMvA5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"njXH5RiMDlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iKcNX590S5jA7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"XPjIlti4qPb2sLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"cBOuy8os8wCXMpL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"LkBN99cvj0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jQVKjATIR2Lbel1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"CWSPFQKL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"4oKWQQdb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"21qygiMcPLKOCkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WTKVVoDYYu2Dr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jGH8vchOEhuz6y\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68cd27fd79a481908feae09dd4df126305b1bff4868116b3\",\"object\":\"response\",\"created_at\":1758275581,\"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_68cd27fe2b1081908759e79eb4c9474505b1bff4868116b3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"9PII2jnbg7eFCL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"944LS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wECxNdy7d7Wt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iTi5EsCGIeDL1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"68acWUaipRvG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JKUn6RUh8lUAp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XfgFFC1vd3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aHg9bWk3oBQWT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PnPWzq0AytJVj3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PBOQdShig2bSa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"2kDEcXvxgGlZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"oXX0PuUOA4oocNT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3WrIktthqfwMimK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"94AlQh4BlD7PK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"kao2WR2i2c9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wxDgd4aM6dHjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GmgO5uxupt4XGiF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"qZ2FVrbsCshEteA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HnR372N3Jr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"k7hSkD2OBc6CKt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"4rVbaHWe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"yuyOG1en\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"O0nle4TdJMdg6Fd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"UUQb5o5DajYnBj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jw1gAabGKprFM5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json index c7517be6e3..809508de1b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"8WV5Mxt7GYQ97b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"b0gDT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"87q7uSkPkwjJW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2A6aI6qhMk6cAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"71DRLF91Xk6f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PlwfWXpCdgCRt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Fg4e4U1OG6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HoR1TGNLVNuEO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Crb8ealHlwvul8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BusAQ2htf04tT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ttdguDa5Fvn8h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"lCUMbJZU8CcU4bo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"hc2pSvZnZpSOwME\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UGDccR95KIChY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"fupBn08wtP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2eImBifCljClu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"sD1F2v0qn7vDb6L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"nHOeAcTMXn23RE0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"lTgztAMzjf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"6Xh5v3Wg5cgsklM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"xZy2HCcm391wlJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"JVskChgMfFWP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"qikn11PrdGJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"6vlFavL9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"6zadtYAz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"WrfE9FSIvOJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"EK6LFyC8RxBv6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"qqy3wNQGn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ehnTdfzcuI3Pmy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"5MC2zhthEMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"97QxWBtAp3M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"aV8C6fUr9EQMQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"fSTZRZiv52Tx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"gXhVKjFnkmUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"IpiVoEl4Et2Lq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"hGEm34W0ahRTxcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"xbXwaRaxfaQW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DfeClOGo9tQg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"8LP9OVF9vMZdw6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"HO72Plf7drytvwA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"VjW2AK94ozp7JY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"ZL9NqEbbMr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kSdRuvqvK7FTH19\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"u0Rn3Uo0GDXn0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"wgMKSDjyjvvH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"0tQoTDebpP2m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"JTIGuUAjyi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"bGWFbUr5Iw5KU3D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"fDQb83NI0FzAQC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"OjIM3hRgPYbn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"r8sewDzqZh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lWYxrA2bfogsG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"9x9lWuaIucZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"4ZPRBfq0VYqX4BU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"IICxRPzx6yAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"9dA0t9bQWkzKa4U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"TJsnuWN3ZApBYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"9TspWiIVYCnFqeP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"29GhST7wFxjr9ew\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"wt2s6v1SAQFnU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"jdGrucRFhqX3Y8m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"9rb61HHEszYi53F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"ZcIIz3WnG4DpQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"4oV6QYT2YQL7Gd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"umiFXjedUZ7RWZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"gN17jDlQfEt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"hPIXVWdXL2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"JbYegKZtopa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fANL01I57nsPt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"l9ruK2f4kYwm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"DZhlrYInqeG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2Zh5mHv0u01ce8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Pp9MdwUW6nn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"PZ8nyDbOfI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mpU0KpcHH9NP3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"WtEiFFvJ8blh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"QMBgA7D6GvYPmN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"0h2mG8erQMS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"VTUJwuLvugQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"QoS3b0UlBZt5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NFDCGfXyD3e1I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"CEidbTBYTm0Oq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"z5jE3yAeDw3m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"Yei0oFhdZU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"9h1Lg8ezkHQAn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"1Xi0rizl5Za\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"QGbmAHUuNfKsqRI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"2N95C3dOXlbAjY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"YAtY0ov5M67ET5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68cd28092e5081959e26a5fa3489ed2f08ad08b5a6422141\",\"object\":\"response\",\"created_at\":1758275593,\"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_68cd2809a1b48195af2a926f62e6fed508ad08b5a6422141\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"w4ks7AWR4z91cI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8iG3EP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ax5FAsQIUVgKA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AOfW2yiImlZotX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"8pZxGolaR7lg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"19Z9xjY71iMm8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Rj0rxuqZBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"86gexCiv0DVaB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"iiVsyvsrYgO8QH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"y4T6l0REaSg9R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"q2I0XdvmzQJbE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QhfCpa9wccur6GA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ldhaQWyv9RGArgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SKTsbA8CoxSFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KbQXC9d09bu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"khbIBGE6uTzC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"qZj1YXHwDOA4Ln7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"12TRNHfBYLKP9QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"S87bogvrAQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0G9XWtYsmsz0Ad3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"lgUYRNo9KfRT6Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"jSQSfKGhs8c3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xisGEVxAnM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"xAb1zAdyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"xLEGyhEq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"V14T0ifMmAU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PRdLROz5vasq1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"szexqhMUn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NGVD3I4dlZV3EM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"iwLCDcfRFvr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"jrSyoVUoQqM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wcYBuqZbZzmtX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"Vdokt3lNKzCS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"MA4YVNwkrBMg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"JC3C0rDrVOaTG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"JyCoBhP6uJNG6cM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"mICDfCo03aKB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"q0fRTGfIX42z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"fOFKFncLRHNv8hm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xYluFlHl2zpoCNi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"G5dIvfZlu73zGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"Ov9drZrWJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"JqoB807D8S3tYuZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"szFsj9ocucBWs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"a1eikFXT5V9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"ZBa8BzAZJN9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"t94KqHXrH7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"g46f2jSyuRdbLN8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"39SJWPo3PmJPDy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"IfJ20DZWGG61\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"VHJae45Fji\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PLqxCoOGovTst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"ZIRrGKHObUa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"fUS1M5yIeDkJy7Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"dECBGuHTZxhD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"YHj52GBJtdD5zlf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"lTMW7iP553BAmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0y2874zkbLKsGcT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"D4BNhL229n2z9cm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"cWt6CFWBpTzCh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"JuUhB7tjKBCmNc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"nO3ai67PsoDXzr3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"6RQ04TbPTHSJe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"8BeuBEM7qjFJNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"7O7FujX1T0PBrk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UdGRW08iN1e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"IQqjSjJa9D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"dIJfUDrBg5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DVCwb3kQ2rvdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"7bZdj5Sp6DqH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"HrAwotLSzNJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"chwNE16LyNcw0C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Mo2rAr6INkb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"RfZZuLwcf6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VxkK2HXqTZqLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"F5axVO8n3yh5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"knKpIeWEdB90wB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"YKS2CLRLJbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"m92snPXArUn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"KzgIJeFmL40H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lXo3OuXrqJ2qN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"z8Z5wcI3QAEqx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"ZkqWJRq5N8vG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"myK1BL1HpY9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"Yg5qPFUMhKK5W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"1GwqThElnsD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"D9SWQtjOJEtKsrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"MP2po2IVFb39uY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8Xuxr1Xow5Uh0n\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json index 98db0546b8..cad2af6d13 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6Q9jEtIfrBRuJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"V3mksd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"xz4wGZiiC7SyH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"yNjz0xuLBi1fX6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"TVqC8RhuUfoq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7M1M62qzYubvU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"hP2Hh2xBTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aU1OQXwlJt60i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"vc5q7HIeJDEIwf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HFC5mofd7vSS9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kYtCvIrEkbioa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"LvHHgoH4gjNdNJN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mOu9giqYCvzWOMq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8cn4OT3auUUrX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"wC4Tz1Abv3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"P72tdXVwowEs3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pFqIibarn4CZ17p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fO0OqsVOWUxfVJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"soRcU8QLUDJBVY8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"hi5bhIqJzMd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"VeXKU1pyQJYmbiJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Z99Gqh6udDZg07\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"AaXnWpUlNGxQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"BHuOyQWIBuJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"4dqLUcUwV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"YWi1XyR7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"iFHuvugeCyG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"jHf1v4GzdMHdX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"Rra75Q4mz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Q94e5hSPYN2E34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"glw8MoT0EMp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"NtE2SV8li5o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kJ0gDzSB5XOgO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"9BwotPDS8tu5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"RwQC74dsO9rA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"KqahXyk3oWbO1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"6JMBhEgcjaZtg1g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"1CgmWUxQRtcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"EQABxrtl3fLa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GQnJoGWWcYUy1Jx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"97C2dhUcpwsav3v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"bc6Ej4G6bWdJ26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"wnNHigIHWc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Jhoozzvqcvms5BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"cu6XVlMiJTUl7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"L8cRSkXRP0p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"4tekWqlSiMSzF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"8T3Z5opKT2qK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"iliZYwkbNjafz3C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"RcDwFMJIKexBL0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"viHQjtWBh9iH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"iXlkvQGGJm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"IRmLEfWECwBZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"IS0iIFMEBYS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"lRNZW6SfGn3QcaU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"XqdRJRxRaura\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"rPQAIxlTXZuuK4H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"GmwN2wbU5l6tn8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ArBC5pWmqtIJSjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"NssLWP0CwAHr73S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"pJuFYC4Rc3hYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"MiJ5sjgD6w1F3TN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"VI01qU4lRYKTFJg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"QWXIHrXpcWD6X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"ZC82dLu3rmORBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"e7kTaJJ9f9lgng\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xbLqzZIMSXw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"LRhp9zoBdy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"68re7cc8MZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VpSTKOTEe7H0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"OefD6wLY7WGe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"TKwXoBfiR8w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wFDx3JEraBh5ws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"nOUMt5IZmhR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"kSS2zPbJWH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"pNPoh7pXj2yxX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"dxKKsQPgNFke\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"A1RxLbw7BLxUDO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"PomNmQhQTla\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"bTNTm4mT7VU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"UnCVZwOW9kUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"UdWdexLc2AqEA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"XXEhAAZjgd5DW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"3n3aV7Vk5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"ajEx7yjoJ9D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"fJmaIctp9JUb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"9dFXrWSJY7m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"gvRwPdYW2iyhHPw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"oV4D1r7UgIH6Dz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"k9iLLnWaoCN4td\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68cd27ff161c8193af144c5e9018d9c60d6ef74441ac091d\",\"object\":\"response\",\"created_at\":1758275583,\"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_68cd27ffa6148193a70822942885d39f0d6ef74441ac091d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VPB96JdDfYLCbV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"UQigFJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3dlrdSHewoRjI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"h03nAZpXxxLKB6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gj3fu8VaJtdO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cFFVh62jJ24hR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"btUuyDMESr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hguXHyhB7qScN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bVC90jswxsJUtr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"e5d3W2QuXpiUr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kxtsf0nAiYuCM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"DS3DSL6vlRaCnxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ymRfuTLz48wIeS8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LZe47aSXpHcaz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"0dfx7hUQd7p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yWdYXXBXC6E3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"JkjsjuVB2XwjVil\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"9wpYbv49d6Jkjud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"J6SMqJUTtVRv8Er\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"nXG6Y2BgYMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"iosRGLCVtzrxHxb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"VArlJfn6npz6jJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"uSNoWCnQq1I8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"QQZvgKDUd6s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"S0d5wjckF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"T75tnrRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"oxTuQndEgoo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lLDtlu3ZtekEd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"ahVvBxyPg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q0nylTFnnJ60BW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"8twleqSdVxH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"0uyPI4THob8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cMlHXytQ2b6bY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"AwGTk3Pm9A3m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DGVOUHJakPlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"tqkC6BDRzEAyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"o0WrovzPG1Zq3ZX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"02m5kF73YqQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"m9YSq8zCd7Vi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GyZ7ajHGw4hktJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"WPxnFKrBLN9F0pd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"LZ64z3DvfHTuIh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"CvoVLLCozT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"cUDJ9qBwJ4MxnPA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"pPgmAOvUx4iHj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"WcowXviZE4y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"FND07qGJn6SMT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"39IcuBjmOrYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"JHrUeJFNZwGTVof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"7N8AfkfcEpTgMa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3nostZGCwx84\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"iNSf4UjKQI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X3GKYp4XroSkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"4quU1pzdZgs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"stajwGpl3mp36jY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"R8jq34qHJheC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"WWl7xnXxwXjumxG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"zaIAfZcXWAU6p5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"FIbW82Bobi2arod\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"yt5MKZd2Ax823al\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"XEBXg6DjQJmwe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"y270hojd2KfkZLd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"60DvXXOZvldFDr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"lYDC7Ebtbt2x9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"FWzydRH3k3pX1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"nXm3R95vKvj6LP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"KWOPc9IEyZF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"gxFuhblmkw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"p9dny4R4elY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"a6PnDECOLdiHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"DwZbLQvSh4MW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"aRMviJMeswn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"om4t0ZvQJVSOgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"LTgvKSfLCW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"Xj6iCcZ0fF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZZGLbF2WWyVMF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"CqlTpUazlmgz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OxiQ5mVGwLuJDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"OIFPMzIoHqC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"J2zFLqDVA4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"XKTzcqc2YYmx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"iKfSbbCo2jyE7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"678eDia4m4ocG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"sb9mp2gSeL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"KKCc92p4S6M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"krH6z2DZJfMp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"pI9IFa12xQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DdqJ4teDpU1SGtg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"4SKavnrheDEbo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"6MMfFESt610GF9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json index f1638d1393..3f1776d7e9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"11US9jd29EV609\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"cTbawl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iWLlrdX1ScUD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BaEKv5lczU3eCd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0o0wF2sLz12H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Yua8CqHPZ7TCG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"S43RkuSgHV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9hxW0C4QkqFO6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"CZJNKgWxZEyeCT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NOz3q5jE0xERf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"N4XfE1kJgSMg8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ltfY4qgjymSdl7K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"sZIL5AmO5xnXkHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"EOLGDBo8tA6xL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"swOsEQzGstS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"lxaOv9izmvJhn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GCSwk2dgTFVRNaI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"I21tQgJk4OMsXEM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"NDv9fDIkNz1i41\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"1mkIoASK7T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"XUtNMIJWza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"E4KxtAu8G8eBL1U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"4XjXpSpUNm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"pvsctZ2Z9vRPJ1A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1OSBUSmEPqFL3p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4IA5ZrKaE6lF83\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cd2806e2c48190ba7e6d857102008c0da41ac9d061b339\",\"object\":\"response\",\"created_at\":1758275590,\"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_68cd28077fcc8190a38956db62103a000da41ac9d061b339\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SloO6QkqlYqbz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"6SkgeU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gFQuPDmdb1ym1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vGz2e3X94syxGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tEfQ5r1v20PH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5qJRixzyvZWCT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jJ77kDNrNC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"St2i3ROuZ3yXB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qgjP4uSHQtXv1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9WIFJwWt9MLBv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ZaWLcvFwFwldR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"DcLtF4obfhMazAt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"F7wNBMn0M2OmpKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jEtJvjHTXRVAi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"LjEXXoDzPAJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"e2tKxOnxDSmgC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Z3oDmmgNYtTEdAc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"8A1XaP9yhGK9cW3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"AZXk341YXpV48j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"DDhVuAybGq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"3aD7VykaVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"bAkLFpOYBUroW76\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"tPHkWOkxEH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"8MWI5LmNNJyZUjH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Oc0EGyjo31wrFN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"P9Vc2rCjySDwjR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json index 782932ded3..114b3032ef 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"s8QY9qSUAJkT4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9nu0lx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"7ICd1GmpHHg87\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SQ99U1qGoiXAfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"i1lzPoB4sJRH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5dIgjcJ1rv3Pq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"JqPgdoB7ly\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vP7du5T8rIkUx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ID4beoGh5iuFB3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"svppOboxdkY7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"rWsYZ3yFjiAph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"PWxViKQ1LJv1MMY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"LEaQhQMNsVGXvrI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wL8tBy88NM8Dc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"O1fQu4A43rY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cgRSr8qYrNxmG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Es64V8jzi4ezRcf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"z3cmlaiLvHSSX6q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"7GxbvDBmOr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"OENyvVfvYTJ4ItM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"Ejkq0ZxsoJwKfs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"4PEbwxJewA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"AoUOhjEPMHZj0Ea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"Q59pCl9yyH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ShkZBcnL7BzPkES\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"E33u7fBxopkouf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"swXerTCK2lqr8R\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd2805851481908fb029c4d2740d3e02b71f5b9d222765\",\"object\":\"response\",\"created_at\":1758275589,\"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_68cd2806417481908ce1f47eb813c29402b71f5b9d222765\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ghuqazEQ1msXa3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"lIOcuc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"5iXAbZfPqNQsM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2tO15xL6k5zzX5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"dZc1OnyrTCBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w9WbWVS5FKKqX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5R1VeY3KFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pLmd9lawh8l3R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ezgrMpz8Od2OB5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WajA3jARWSjtD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"AQnNmmBKi5jAH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"82oGstXA4ngqXLO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"xiPduLrMV01Wday\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5FDwgEwhgsFxb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KIn5Ow0CZJr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vXuXUzoVMkGFV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"FodvH7wCTHDEuVQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NQ2lShtX6X8dceH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"YQMB1dNwn7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Z3EUYeUHqBRth0f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"jO7ku3oGCrXPXc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"R7cM8ZVLeE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gdq37o1dHeD4dcy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"Rf6vzzXfMPO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VBw50UfpptOeVLD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"QVHLTOyprnokQB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"U29wn01W2yUSXj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json index 0c68a1c040..488624f6ff 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"MARcyNUXcHLLmU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"2jvDpg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PBbEoHCB4q1RT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OdsuFwJtD0ofxM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ssxAQDiuxXQA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"IGTxKVTCRsJJz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"awc1JnOM0q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UrAch8nSuPBYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"UB2InJEeCbvtcG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7CpMzdcoDCtnK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"14VCCr2CH9CD0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"y2CZQgWGJJI7cpg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OLQHeJmO9HUbCDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"oZGyKLhMsDHhd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"dJ12pokpFbb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZFATTNPiAor4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CxPTM4LJH6lmGOn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"EIocq0ZhxVajIHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XYzix2zJk10q5AM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"13vY95EnO77\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"IFwsxFThXELP02G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"adQ0v6OLdNeYmH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"iW0T4avCbYkt3u\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd27fa31488195af153240cf1714dc05b9a3c27fcdb555\",\"object\":\"response\",\"created_at\":1758275578,\"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_68cd27fb2d208195932eb9956581a34405b9a3c27fcdb555\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"y0lVC2Hfg3Nml9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Vfbaae\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RvLWkWJWNxBUC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"29tq3GiPcPgW7A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oBOKsO3VDTKz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hBRlRiat6sIBV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jnCCTRh5kA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ejrCuhPpFSzXI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"A9ti2MouiGTooO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nv9dwAH0LBR4A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwclAhRMUQvmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"iEAvesSTtLXr4XS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"VoDaTuiRMwBjsU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y67BamOxh7qNA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"G6RgJde7ukx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Yh6VO1kuG8dUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"q84LzfjYqSyzeZc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WBffAGLiSvSHWas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0tInZXW7DTdYXyP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"gwD0FvrSZhl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"LnY3o8ZAQ56LNPc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"8Pk7hTr7txHaGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"o7lqFzHa3e6cCg\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json index 30e3285183..7b85155e97 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"DuYe47vn3NRiZs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"eqh5ZT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SdztBl1q8vGGX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3IuPuvDwGr3C9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gFTxMe3sqUso\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SlBF3cLrrr3Jx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"BL96ZTgkj0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6PrraNo93kuvn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"DaJvrd2KVnYaSt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SqUGvwkrm4p8f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"dDLeM2PgDXCCr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"D2H3HzpFmlhMquO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"JhMHGLvo5MgswXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"taeuZQ0mmo8ep\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"SpquGbZjtpY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VTT6aVsHRAhvW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"r9eryBGFz5pSgXD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"wrzQgC8OoOdw1m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"3TpE7WNmNt8Rh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"7LLiSaFJIMjBBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"iR30UM0boQN8z0u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"dyEf5DzpyRsKPX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"iZXJM2TBUgeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"F4Lb2bzyNpMkJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"wSJuKRGcYalR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"D1lGe4WIPlsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dQvWJrjiaIlWu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"58Vpzjuesp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XmCHPjryDMPdM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"msXiuQcCQKMQPq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yQ7ayqmrsgBdE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"qdxln9dwHuVNN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"pTwYDtSpcYlvoOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5BMNHZGVtMyroSN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7e1i4LOFPLR08\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"qW54aJBl3NP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"41IEi6tZ5UOAA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Y7GSz7F9MR5AANQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"o5He355YTaW6K4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"EUkAQRCupNzt4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"Jzt0tw5J7O1VPl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"qXm1s7LFX7FWsQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"nyYYpxEDbfWUo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"0ZKV8Tb8E68I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"w3pGuZhy9lqwFHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"SZO9VqUy7imMvj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"f6hfcSr6djhYEG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68cd280e87488194a3adfd2e586f3201078666e6ea52da1e\",\"object\":\"response\",\"created_at\":1758275598,\"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_68cd280f29d48194b3188d96d33f8f6e078666e6ea52da1e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"v5VOSVaNpTeNik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"gXS4n4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"65Ri2HxG0mExl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfiX33yJFEKmTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QeAFT3iAymTi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fXCkkViSOsRT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Boqrp90OLY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SAXiLgImKHsj7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"dDGsheMIfxXYbr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qqqSm0CFXtUV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fr8ukq8KpXgdt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QBsuMspPMGeUjJu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ZIucU8XS8RBdyst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Z1n8KDTwVmbaw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"jCHx2y4JtLl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EXwrzDt2Gs2zX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pdK3ncHSt04WYap\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"rTYykRZ4C2y3JC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"QOJJygJAqaYsNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"oTjKkB23xDb5Lq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eVQTrbjryIgv0pI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"FcWPv2ecjCa8qp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"xjKxdGEcQ5yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"I3YvKOGe9ad6J7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"I5Sxw8JUso1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"n6jmw8S4mXHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XUi5xflEF4hPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"w2KdnguCUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Y5EMcaTNA32X3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"lDwf3XMlf3mMd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o7YoxMUbzXvOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"jYkbzkdS3tmBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"9VdmK15TjFJ3P7h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"isy72E4HU9UxgXg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9kPlFT33Uc8Fc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"F7nfmitFpey\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7sneAQSu0WJYE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"2YKcz9TfKMtoSiK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"oHjbRBkuicAvHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"NhCbHHHfAElThH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"8GtZIakzqalAFU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SX1OyfazwG0X9jQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"nlRqR3juNQhy7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"BmSZqaKlAsVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"jaPh1gw1juIBmXU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"6T3xG1vM9KkF4G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4Q77o6T7JwlKdU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json new file mode 100644 index 0000000000..55a4269821 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"PI8ijNIXOUXHvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"O6lkoG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FS8DpXA7AQ6B9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"89lVrAsxcgDO0z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jRfC3beVaBDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1Rrt3mmrjWZx8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"7H8gmMhvV6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"R2TSyoaDoSgCn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"BMHa1UUw4nXZ1r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7QiG10E76xZHr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mNmdp01Uc16Hu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gkbBCEyTmxUHkHH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"WW1b06Aj7xNdrc8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QeI1ZVeP4YrUt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"mR7uhkmQ4Si\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"176M97PWAHsTU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"5G4AM7Gc3mCd44u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tNmAw2f1TLAKUlV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6aJix0Yt5a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5Znjas44h16Vh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"pCL5tFbgmw1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"SIX3T3oqlU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"jKWljldlGWqxKqW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"iGj00qrfz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"PAk1Xt4c97Ek1uI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"FDelKCm1jdxKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"kw4Hdqwwds\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"PmBPKeN8ARaYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"hV0gRi9WHL8fR7e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"Ydcpt8OTI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"D9WvFcX4wMFvkbO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"RwBwSvqSbIWvAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QiDn5JRUEvpNcV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":40,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":41,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":42,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json new file mode 100644 index 0000000000..edc81b3587 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TV5k9QEjuHefTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8WafxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZxJlLck5cS8O7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EsvOYBuiadU1rW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0XWZa6PIZDkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0YHmkohAq3u5h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"j4Vx7P61el\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u86rNq40wocVf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bE5QLso00GEZcz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kJq9BhKqzDMhs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3mXk6pTWBXxl6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"niAW09ME8GY1DqI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"u73id6Nz8JjiP4Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xy6qIDbZp1iTM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"2HeifpNBO8i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dnOlcQkhJAoK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1tgfGugIb6z5qZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"TaWwWJnJHbGGNSU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"UzvkO35ULF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"S1F1bSQQWQcY1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"j4VgOHkqYzGQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"q6ZRAca1sW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"YBFfIOzuDzmPvnc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"Tg2vqz6MnE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"qFVNjkyWrJl4Bqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"JF1nKmTDJLO5z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"obfuscation\":\"VCoRFnHGxmX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"t1blT0hp05LILY6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"i2K29P2Sqp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vsVAwZFQd8h4wNh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Y3CVNBIMoIYr9m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"o5yMqRNWpcoRWx\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":40,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":41,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json index c460729888..f590232382 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"t31MkQEp1FIbrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"F6Y2r8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FnJm8ny3zzcq5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YwAyjfrQUxMPbB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"w7spSTVRNyFx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8l4fHFjZiGUGt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"I4wodxskNt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5ik0ws2qPKR0y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"H8dPbawIeQvZ6n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SKex6HiCOTPTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ucvM8sQkeLL9U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ldpqPHQg7tJ0ESF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Zsxva7H6H4wnwFC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Ub2AJKa1r18uf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"POuiCg3xgMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ORIWC9AtSORbs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"fOr0Wn9BV0Nak9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"aQLWhe3QbR6v5GI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"cCKMiGx5ssAHRR1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"aDgxhdqrlD7K5pp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"ictoVNnEDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"2RuMCfGwyhnBy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"YYhmd6Uo75adhoY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"gTJFbxY8qi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"rbJKqQsJbNqTt2h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Ey5iUBxub1Gu5w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QzCKEqdB0DOPci\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68cd27fc6b248197a405ecf5bae4472c0b7e0a048501bdde\",\"object\":\"response\",\"created_at\":1758275580,\"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_68cd27fce3dc81978bd9ee1907b002940b7e0a048501bdde\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"REDXNlm9vtu4fp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DJPJ8u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3NgDUHfvRbqXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CKSi9GenMwoNxp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ws3nwJ5YBovW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ur9IDpqjhcqW4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"nJPzxn7Pez\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"85XIo9zARYij1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qILExtUdh6AEs5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HoJobUBRweqto\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"dstdL3DLFPdzY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"HFzs1xYWCqVH2oH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rtHOeha8pm0e7Yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iLDDflgVNeGFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BMZ7dFIa067\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DDzwiulN0kY7L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"IMpbve09tRIXIxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"RBhtQns8CZirYK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Ma4cz7HAjbWQQRp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"4IPqYrVWMpmwStz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"XTAhCFHJWw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"ZUGIXYMOuaOJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"90CmyUJqR4rowom\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"zOLDxczqA5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"UJuOH7p2uiuQcza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AbpB2XejCRWt1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"r8RW5B4MXQtwcB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json index 9d3120d6a6..7641c41be1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"aSxFqW7Bz9XfUL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"dNW0HO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iacjWCez3yJEY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"rlQf6Ec6TUKPJG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gFpL4trXy22j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"s9qvYZDOdGM05\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"goxzkyAaeB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"zU86UeT3OY1at\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"083BXc2UlfVxS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YXBmgD2NikiYZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"0Uc2eVBnsSUOK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"6xLFoCxZuavqFBh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aT3Ed97cCYpI3UN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vauvjO8UKoPBF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"E6pjvDlLzBc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fMHDFsywZXVcg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"vfi4QvaYD9Ywr6u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"xZaLg6XC8tqCLxK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Ze2LeXslScBHhnu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"UwpCp5zJxO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GSHOECJrmgXPdVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"p6GYe50mwK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"dtndc2XFqwUy3YA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"WMxB7yW8tZ9dTt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"vqPmTYozuYMnoA\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cd28144c1c8195bacc5cc7cf580b1a095c4f4e8ee45cc8\",\"object\":\"response\",\"created_at\":1758275605,\"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_68cd28160ba08195bb3ed12dbc5250be095c4f4e8ee45cc8\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"p7ZNbX1aK4cvXx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1gD3TD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"lUsWxG1rd35BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0bDNZvv0yR9Xsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AW8loma8e7PI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"f16GaGhhhxUCi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"vbqU6vBsvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HfbFDU8nFuvxe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"pOVjpu7qHUFvJ8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LM5bkt0ILDo8N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3IEf5x4QfSReW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lExjOzYkuK4hMPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"2geJu0zZx6yr5g6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pTSgyhMSTEwAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"CnMYU8Js961\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3fHRHmP3Egt3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UV7p4gpSdKjNttg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"hTlvozCsL46uEjg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"tp4kUKMAfQ3tbUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"pXBThZhS0t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ta7M5Y9x1UdLoZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"OPMq0juYMJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"9f1lxRgWIXFzej9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Onelt52gnOBcXN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"XMeDUjCvC2L6mc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json new file mode 100644 index 0000000000..3500a04c88 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sct1S3nioFqBrB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GhBkER\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"Ten5NhWX22Me4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"d3Q1tLyngrbIh3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"U9OCuBxGuDUI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"v892iZ4ggMSJC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"IcYzFEnoAQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4O3x80n6cGBVj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"a59Jdl5iDnE1Zq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"scFhSK7XncXax\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"CwFJ8Y6zv3Jza\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"jJJUmTrFWfJwWN7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"NiNNBaKUFOYqHaK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Er8RVTmzspRrU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"PRp0Xo2KLh7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"UkU59GMuxY3vY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Gc3o0jOFqkORkTL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"FRcmNw5aNubt48g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"pZGxsWzEOpTJI92\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"Colored\",\"obfuscation\":\"5u29pKK8Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"TAbABgDkVMw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"crXTKD7CT9tD90\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"iBPMVzgnQqtR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"FDu9KUTJsZqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tvFclqgwDfEmN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"hxWn5zJJLX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3qhFrlItGQ8kz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"tVboUdpBAXppmG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"9LQcYqT0morWQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"nIEMTlI56QqWK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"jKcBpLkFLMuG1fc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Dl4fS9w4vA7mBi2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"G43MwTtR7pqc6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"vWZnz289cgI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1tjmM6EE2KFhT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"1jX7jcqAB5qnICc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"O0zQhNBWFiYzLKI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"rXaTyXyqCrRfQBa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"Aligned\",\"obfuscation\":\"vtGT4mExT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ldifSB2bLR8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"vh1ZkUEfXNzCdkP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"uzd4tVGf5hOwDt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"AMvOx18Ih7jR2D\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":50,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":51,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":52,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"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_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Colored text

            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Aligned text

            \\\"}]}\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json new file mode 100644 index 0000000000..c9c1f174e8 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JrURa3cD0uOElS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4XoSpH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"o744h3djpmbEr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lx0zx7ovenHUmg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"05dZa5GkzqzH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Ib4ndr6sE1bXm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"S1nWtBQK5Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"vEpXKscSeyVjJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"l9SWuHOOVxiNE6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zTnuYVJvpxlZE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ccbT8Sv8rEn4j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"YM89uMgntofIxUB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"AkVoMtmysUXVClp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3oG0KSspMKPq7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"2RcttcC2jN0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"T7dQ7JzILrEdR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"HbqHGv94tzYstFe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"y3mw94Gbqvua8Yt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"03MVNMvfMJ21LGj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"1IKtfCUstM2OP6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"nB0Ls7P1Avkfj5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"jtzGFWcDJM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6Ghy0C5xKkjPHQg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"g08br44ytIM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"WYoYFTcYTLWV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"DEDShBvm4cW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"bRnnCUgpd8Kx3RH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"2hx0GxktaJi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"8yagUle3LtcVO12\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"VN5wcWyZitqy3l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"5B8lU3Q777MojN\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"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_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":678,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json deleted file mode 100644 index dc61c76dc7..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a5ab12392ecaea8f050e07b016f62dde.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LKZ37ghHZ7Yyly\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"vy7mbl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"X4yzhSRWbe1nM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JKL5EeHDWD8BGE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"9JXqZcYTFdz3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jIoZCedRibu7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"REzQmahc56\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1L9oQzad5WHkQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"d4uskjR4Rktb32\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1AodJmayeiFje\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"63wsQzSDHEvKp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"rSv58tn92JJBzwv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"sB5rvsDitKfJGE8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6gGHMZIAn5dZS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zuheiAcTEcs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yzo6CxPaCospV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"RatDqRpNS8wBjHs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"a8kzBkd251W4okp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"lUjEgJ9Kgwzt04q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"hXZVfJWf50kDMA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"3ujbRE1wQWdB72p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"4e39bzTqSI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Nq8uFGHV7025M1T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"cJ16y326tQu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"MynvS5R32wks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"V7tX9EOohSR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"MiCZBACnVaUu95V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"SNRBYauwtHs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"stLU647Wu8swhik\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"UUv76AjY7hHPd0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"gi8TAjH74u4QPj\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68cd28fa84948197bce3403dfa0cc5f208f27f8adb6c3e2a\",\"object\":\"response\",\"created_at\":1758275834,\"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_68cd28fb3bcc8197b22e1678bd067c4b08f27f8adb6c3e2a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hi, world! Bold the text. Link.

            \\\"}]}\",\"call_id\":\"call_kxtOyFsRRHdfj5fKgLhPDj8h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":668,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":44,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json new file mode 100644 index 0000000000..a890e53e18 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mtm3rE2hWdEWcs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"cNLzLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"oZaqSiChf9vOw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"vbRBsZ6BlJWL39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"uGc0JRfloHw6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"cv5nb9CJCRIdq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"krF2gl6dgo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QZSKZH4LfsSoL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"k53Yjnsno7IULY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"avT6HrBXp7rD9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ImQzknuMn4pnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"ViUTiTEFQ5EG3xB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"JZ17ixiRkHnDJOk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"zyrb4GV6IYcRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"I8tjD8r2LFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CPQZVYmRF109H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vuQUeqYNeMmGkGS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"DZ5Lvzre2KQXfsX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"1Z2AMXzt6q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"c7a8EY8oqlwUNb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"EBwWa8Ktme\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"xMlPgaw7px9ozRP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"hPkY0UkKYFn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"emtnjr4RZga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"pY1VbZeozNM22lO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"yuVqDntLzAH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"dw6oRI1z58bgpmT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"GqhvPkCeQiMBfZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IbO230LZXxy9a5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"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_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json deleted file mode 100644 index 32431028b8..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_88714755dac24eb4dc53b3992c66a843.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"u93Kz106p3poKe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4KSK5e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VgZdOOxlC4tSh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"jW6BtdK0gmXHw3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"A3vKWYOlCUl7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2Syub660YoHVk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"u5ejGcsghB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"lOSXGbkP0JwO5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"R9VYJJl7UFMVJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"uSb3slCyHo1lK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Qiph5tS0O6gUD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"zcR8yw4MjDQh4IH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"IMBlrrjP5mQAkhE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"BagVYZZt5kzGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"LWrbGxZhWAF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"FFdfSS1x325hM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"X1ZkKIujCpRuySQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"BudvrkSQRECEUhD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"jTtAqqSVGK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"xpaGbZnssoe29RX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"Ea3j3uV5To\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"UIaLkkF7b0kwCUY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"5EwvX3KDUqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"pijh7apFm8O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"K82WlVDM1UCSVkz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"LJab3PbVUru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"cRtJ5f5FNvoxPNB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"zwc21CUbaAUj7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Dj9YoHhQZ48qWg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd29188cb48195b5061e01fed7bba80625902a5703a74f\",\"object\":\"response\",\"created_at\":1758275864,\"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_68cd291940888195a9ee087f4cabea390625902a5703a74f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]}\",\"call_id\":\"call_NPBhZWLn13wqYIgRVEtQreJ2\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":662,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":42,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json deleted file mode 100644 index 3d3a6cefe1..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ca97d41aec2616b40b0bc40893a79c89.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9KO88EwkHENVEi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"PBD6Or\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"aB2itw7zUCsac\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XURtAntThp97hj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"6wx7ybOIg5Xx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"8Xiip26OTBShe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"yJOgG3HkVA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Lh8BgfdMHpqpe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"5mNKaityNnxZdW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"YoGr22e3cxAaX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"q4F0g4sIXinuG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"6n6ys0KYuzuNAD3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"kVVg6UufTxDGwzV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dyMOd2hy04C1g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"8PsT3u7YV0i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ANIybj3dXALtS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"NxfgAJPcXIoujZB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"0aZBdLrt6x0mmG0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"DFxwbsbib2ZjnsJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"8xSCQf4zjzx3z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"lCuRYUGwiI6r1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"aFBimoTo3G1DNhH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"cAwlA4aEAoRHtT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IBdQyzsVwnZBJ1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68cd28fe57708195a6cfa75f859a2be701775a599f5ba1f4\",\"object\":\"response\",\"created_at\":1758275838,\"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_68cd28ffa0cc81958e6c058f048196ab01775a599f5ba1f4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"call_id\":\"call_l5k9VoVYenj990m6vzmjNvpj\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":527,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":37,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json new file mode 100644 index 0000000000..8f95742e84 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IDnc90bLKvCG8x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GlhkUX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"EK5hjRfmnvja7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"HfdFtgikkrdMpa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tdO7UpIT0aBw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dcpSpEe6OG9Dy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"jFHU9lajwe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"izBPCE9RQckYI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"iqsvRK4Mxh8aR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pVdIxG038TINQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"UnjZ2mtej8vdR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"69Clcg8uf8bhVX9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"mEWY5dd2SYskKHc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FvjDVJA9PLRNU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"TfuVuetRM1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CmF0QnJ8ptIrd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"JPlnvsWXB2Xtknj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Ctu0u8x9pa2mpE9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"p3tJwx0pEhiQ1V9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"JiTLiP9l8Xi28\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"wutwaYA9sIp6k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"4orJfB0LoGDhIsI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ij0rIcxJ8f1E30\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4Ph5zQeCXbXuB1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"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_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            APPLES

            \\\"}]}\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":537,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json new file mode 100644 index 0000000000..863093c65c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"cCVYTqV5A0QZ9w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"9TyxXT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"pXUXSithKguci\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"eyMHo4mNwfocQF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"iFOymMcqV3sF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NowPonwCq1UND\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"b5n3cpAK0b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8rw64Z46HjGMo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"k8glsXmd7TyxNG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3UsyK3oGaLePa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"pBokYsynHrj4k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"aoU9YB2aw14YoR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"KzTkWgx5yItWFha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4Gu6cYnXgma2b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"9A7myDzRTNI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m1lKTQOzKA8lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"xiSzuzn9ndJzQnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"rpudEqS5oTHfAmw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"PGMQxnBnktUfgV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"QXAJXchCcsY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"PJUOpuHEVDFD5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"4qzRlywvvu5j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"iOkZMZN8sP1N0lD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9BtthJhtmwsrdc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BLrZhRoUqgbNFB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"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_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":539,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json deleted file mode 100644 index 5fbbebe82e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_3d7ef09df29b651e82a55ccc7129f343.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tRLMO2fIdtuJeC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RtXFC1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"xfLWFGq4oGKB0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"t1A6xLnm7k1Bgu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"q34FpzVPDTrn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dNZ0d2XMtYFgY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"lU9J6VAIhR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"l3Op0zlgRrgBW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"z4d29hAmlTBk7T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3lq4rRqZvygl4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"aXFa92GexU7Du\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"LXY2J9Mco8Ah9pQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xYEfgQhnvL1rynX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ic4ZZMlffS8XB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"JO3nydnfop6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hfW2gtT1NlX73\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"EJzFUjrzsituUKr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"fEVBueYkUpFugez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"wuwQJlwQuVhXzG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"avR1m4QCYNZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"fKkE3vYvVjQVG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"rLr542YG8Sp3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"fCEvrhIVj3drcyR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"27aliozdIZuA0B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"3trvbtpJjDwPTZ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd290068f08197815f74d89459b2460a86525ff80cc2fe\",\"object\":\"response\",\"created_at\":1758275840,\"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_68cd290202748197ab6bc3f999246a000a86525ff80cc2fe\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            I NEED TO BUY:

            \\\"}]}\",\"call_id\":\"call_P5HRe8kVEiAQ2rk672fFkf4a\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":529,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json deleted file mode 100644 index 8f128afe53..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_2ee4f417a0603cf9f340ca8b84a24be6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DvJq4gJIDlMgLL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kzwuJv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"vKD2PJppfPdQk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"492ltykClOi3Ak\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"J49Nc54RHQvr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"aEkTlAcX80d1j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"OnL6O99CJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HrhCoLMLuvVm2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"PJRwaORTpaoU3T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"IlNT7LiQWDA8y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"73OV4veZppXcy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"86IfK4weiXubcFC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"2sJ0pAKDwUY8H6e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"clc1Qlu949sZ0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"iBsADT4RIRK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iS54fTHDh1mSu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"NZT2BnL9Gxe1l7P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"wocRt3Y18O262fV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"SZY9CnLjQq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"ejYP9IPaD2hIrmc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"6L4UtTReEry4ES\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"ji25IjMTpZQz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"S8OceMYHkGB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"8PBLiIDLj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"yQrBN4e1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"Uf194ixM4XP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"coJNVF01gd0UF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"qTKA8aPUo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"rE5SxHGSOBw3qT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"PTrCx2H1yRX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"eEkOyxMtx95\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"HQE89abNKUEyS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"hpfMzU3AaZs7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"0BdtLDtC8KMA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"J8T0KforxBCq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"GfZfJDlCh8MkULw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"xzyrX8Vm1Wxy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"sg73MTIGH3ql\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"tF9s4CnaEWmHtCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"GISitwbcs8iNbez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"zU4o3nVuTGjS6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bnkkP4Yd8daS3u\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68cd251de6d48193b409b45ba70f58bd09467c55fc07b82d\",\"object\":\"response\",\"created_at\":1758274845,\"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_68cd251e69a48193a82f5bca385913c209467c55fc07b82d\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"call_id\":\"call_sUbVEBJgAcZ8ZK0FtxGhrBSX\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":660,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":57,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json new file mode 100644 index 0000000000..cd6c3bd531 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Zi0cmdtb21ZYhB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Mw2iX9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"qNWlz2lR1EzXB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"yyY9TTiEJodd5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"MzvRQBkg82CT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"qH7bHvgKngVv2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"kJA2sPWNnc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4ULt139dTE5rh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"jFQU7cCPPxpN7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NR1wpoQOySGAG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"5J7YpRwh6qOma\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"1DJkYJqIEWXgrOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"fJHrlmwr92r2cxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WQAKWbufsjVa5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"E4LIOLB2jeq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4KYS37OAcxltZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"GmHA8apNByzY30f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"u0CmbLuxau0GYBq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"LWCekwXlQc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Zq6YPoQGHWwFwMC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"OXV8fbRW5vXfUr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"M1SIBdU3vYJb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"SBD4aZF8AiY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"DDVXV8J0Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"V58hT2Bk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"XmAroL0AY1Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"80oANgrbvoeks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"lG5sKkzaT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"BsMEPgInfDGNKh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"2p2JWTpS8kb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"iwgSYVd4jek\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SbxJMARMwyNui\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"EMwRUaS19VeB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"r5QBeVndgWtM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"YZL83CSps6ASs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"8atCaezQjp5Zvz8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"s9nGmchzH03X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"xHUCJSfBuGGJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"52TvfzjMxbaPTXv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"F9K9X3NWhMOkGZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"P5Jx4I2Fc3vU7M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"B9J499eU3aICbN\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"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_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe!

            \\\"}]}\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json deleted file mode 100644 index b2def1f0ea..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_15387f9c27484f6bf8068f60174c14f6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"EXFoh2w1GgGqaW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5FE6Y5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ONCn8b927mbgC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DddMKQJzbKXSE1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"bpp1bcW4KUUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3wB295Epxz8ci\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"5SkGxiKqa1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"qmQPPOlcxYHuo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"lO52py49Ri66cK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dcrTtEmPWSCSN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FVj0e1NxY7BEV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"YETC6IgfEYRBA8Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"VZILDeqBQuW7h82\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4XMg2hANGLmXa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"bDW77kouGNn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xsai9EeEJQgal\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YiCCGgpgiupG18n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"GrQiakyTIflwwMk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"txpRFRv32lGgLTg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"ITDxpuzURDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"wONOQKn2bfpB1ov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"sUv6DyxvKFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"KsBnyt1v4B5xO0r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"7UJmynUWwjIzie\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"m1vhgYM30s8jmg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28e8d7908194831af064a71308140b0480c2659b8999\",\"object\":\"response\",\"created_at\":1758275816,\"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_68cd28e98814819486ddf2d15f2acf890b0480c2659b8999\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"call_id\":\"call_UN9GyUWgHKjsppjBTqyfmUJV\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":651,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json new file mode 100644 index 0000000000..e5d35cf047 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"eoP6DZlaXXzfFT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"i4HY0q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9Vt9EhX2DUiSZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"oMYbDGxAwFSbDA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Kyapnlh3eO03\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"b3E53pbE6TD1c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"eR49lRTFnD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GJRQaSTNo0FHe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"EWePGlLGtRwkwb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"t7Qgz95Eo1xu0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"avGRezg5VsfnN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"5RSaUjjaBhyCyYZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"uPLveZcnbF34Q43\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"op0YAm6tyQLRt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"WqJrHMbHqB8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ppl15tr7HsCdm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YQpucEHA40h4yS5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aoUjAnjPO5JprBZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"RnJh4HT8yvePYqD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"lzSOM6lyHDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"emPWj1hgIeMpkXa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"kLkYBYaYTkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"V1xW4NetXICIjKZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"iO1KshEqXtjQXx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OJw2ITm2xdhdlm\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"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_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hallo, Welt!

            \\\"}]}\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json deleted file mode 100644 index 58cce080d9..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_0f777e7030958cba6d42fcaf488c438c.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2H67WeDq3fQ0em\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"zKCD5X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"PqUu0rjD4JExM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Aok2gwlaBTqRz5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"KjcjD8XzrQpy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"igLGb5ClknNlu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"byx83YqaBi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DL6AZPDkxrwIm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"FAM8hsMZ35kylZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"OrTCZi1si7hLK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Njtc99TNd1Kd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ch5jPorPC3yJq2o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"QZFnpnQUk3rjrKV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GxiPQbXhNMv2G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ot0dvLlvCVv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"KhqFC87pMkdRn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YqwIzIbZ5oqMh4t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"IA96gEeEALY9aFp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"AqYIGZfD4P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"562FcDDGz27wKWC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"Fe2TG8fCWGccGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"Eo2sXSNhw6b5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"FDLPmVs8T1x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"aZVOP51QA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"aA3AdsGH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"BNOFzl58T64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6OwexSrd4cMhM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"v35vAuYpP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"EfQVm30kVJyQ3E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xzoPwRjbHBP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"m3MtB1CvJpn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ZOjQoHsi8Lz0h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"uvObDuTMYSo6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"jBRpIxJPz0ip\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"3vcZDtDxLr4D7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"IlPh3vJ1ozSfN1f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"uy4XkCZ3lyyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"gKqiaGPB7TzP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"j9E3IkNsCsy8Y61\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"HShLGWAGhNtd676\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"kUhZRO2vNzEY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"ymObqCnQaB53\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"LMuNlh1aIvdA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"RJwMsuXYLW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"Bd0LcouXySVec5r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"QU42LUCVcdvVqc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"76GvVHQL4G3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"FEOdpfWa7j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"OHYaiiq9RnTZr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"D0d5XUiiSIv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"Hgz7rqTamryQlUR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"FsPLPJra3DMC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"yBalzN4U3R6C9Jr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"AubnASfdjUykcw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"IQL0XpHgk8h9vlL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"yFbdFD5c6ukwUs9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"GWuMfbPs5Uxt3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Elc67PdQOoQF8n8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"X1qTP6ClpQxuQSv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"9uD6fM6wbshXV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"PK2cN0bsUGuaT1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"KcRJP1rXOiHOn5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KYg5vAW9jcy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"EIVC0QOT7i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"Yu5epaYaI2X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SOsSuhPFAwmH3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"dtxM8jKm6Tji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"ymfQDHHIW4e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"qSWFw0UStbni5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"S4SxnOCO0bD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"qhqvCx197U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"PtA3tsq5egPdM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"LAJrTgIbywrq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"YGl3ErYOQJtlfg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"gDWQqOThCSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"hAwl5H7T1kc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"8k9brISZio46\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"dfT0AQxFls6uy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"yCucYnVAGhius\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"gvGPbCetIdVf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"AeFWdpIUUxR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"rSD8S0cUKUzqO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"BnwOE8PUKje\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"zYspBAqRHSa0KMR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9gHNCZ1bTPZOcA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"zm4eA92qYoPi1X\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68cd290ed97c81958956f2f43f8d07030daa96f761d438cb\",\"object\":\"response\",\"created_at\":1758275855,\"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_68cd290fffec8195a489462499aedbb40daa96f761d438cb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_9K64ICgnD3j10DoI9ToQLf6z\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":653,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":103,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json new file mode 100644 index 0000000000..a3feb6bcbb --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"d32U2IK16ie4fV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"lwzkP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"C36fTn3DVlNP2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"KkNILRaJaOSQ65\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"1ii3ZrZjZ3h4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7lEN7TA2Z4vg3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"1KxedG9qVR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"AsDFCB9S1XVyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"66y0o4BVNjBXdz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zbavezMor9l8Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"o3uiJoEFWjt8j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"DWXQTKN2kpwQViG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hYBpyUx8INr3OJd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"sikJ6vJo0EMvD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"TTyBK5n7mRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"lyvrUmZIEFifL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"EwMiBtkApftnUnR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"u9dHDe6uIsbbitx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"g731oUDJcL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"p3PC2BaIytP1aDv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"iLSVZkllXGwGTd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"LlkIrqTQQ86J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"t3PeNqO8eNC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"DZxbJAuMQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"LCmjcKN4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"9FK4lwSqEhS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0gABaGH9do4nH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"gIV2IDLw2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"avJ9HOK72wg3z8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xekd98ySTEn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"W7dyVIrNMYx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"igj4Vw0doy9Hg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"L0DayxaJcO0x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"rkxcF24Ckj5m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"LkBuMf0AUEiLP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"7Se2ZTx7fSLIChC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"yDCxud0gDVXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"IsZczhLNmRGw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"t4wDwxq3IzJ43ad\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"AnOwZowPZVTpMkp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"mOl5545HGMWs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"BDp5GXa3zUXo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"yy0f9xaYErNr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"RPR1cUBZlT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"88qNlG0X1s2Y6WI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"PR0z8bH6re4G7G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"5JnI5TxOYjm7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"qXDHHjGDhs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"CUYeeibX6pVKR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"imrG9VsAuCb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"6ohJjjDh6ofosiO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"11qSW6IWJlt1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"yZxgDTy8yd2Hwig\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"9uWiLyp7CTiPDw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"I56BqzdBZJWj4Ay\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"IKnas7fPfOffJ2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"ZM4biakUcBkkS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"K9pstrVjAgC4vTN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"ajM1BZAv36ITMLE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"JlEaynLwS93Iy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"Wm8fUdyZZFn7sO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"oi5uKuEUPS6HSp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"1SosouHAfQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"aMWGFDxP91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"nYnJUdmkjGJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"zJo2nAKB27MOB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"0PmLfgVDRVuK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"vN0pq0bhDlh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"QuShZjF0tZS1Rp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Biu5OH5Pc1q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"09eorUCv0f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"vyXw8JyNCMnvp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"8k2MGXwzvFjL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"RiVj2vuMmybKuC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"JvyNYaWkdBI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"KcZIYXHMgxw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Gq1hVDyIt0iE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"DWeO1yrsRPRS8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"3s7kfgv9JKnOP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"DgxHa41u0Yvx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ob9RLSc6ms8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"TJcclvQhzP6ED\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"ybaetcA74w9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"5n89ZWM0so2M9QN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"t9B8hqhV0B4Ngz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OoROA23pjOOoJX\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"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_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":663,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json new file mode 100644 index 0000000000..82bacad450 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YdKa6lydKpCF1W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"w24hbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9TqxfwLKeK0Jg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"KwaVQ3nYItbiWN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"dWg5CfqMnfTx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3JVywBhPY59Qg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"p3zRMYoF8V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"uaNIt8I3ErTXb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ra3IiqpyNyCA56\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Tp7XlyrZ1fITl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"SYesGX28U6K20\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ZPqv1g4LVHZpFQ0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"3f4W13MG8pjQdVI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2KpzM6KcpN12W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"fDnNxwX3f7t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"E5bEIO4mpv6uB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"VpjTMCclOP4eCmu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"qs4ArpCZapvOYFi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"g2caB0vJkV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"ajV7x75vwsvIfa2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"2DUhPTQQaCeQKg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"rp2VgSDR23\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"2Ii8CxbTMKMkpuX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"lyqujgtO77C7V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"G2YVyiofKTAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"m8i1fj4uqABo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"LFpSOs332E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"MglNiEvK92to5ZG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"XutMr7eAFFVBxw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"w5ZCwNoUzVXO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"13RgCbWTUd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"YnU9gZigiFZmJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"LPZd7kxEVEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"HyroAABFo0P5SMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"yAfDUo90Sq7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"fFEkZI9kuU2i8CS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"SUNdMWuE09Zy2O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"9is7tMQ3KJHb6id\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"FwW3VutIoz9aALg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"tbNFM4SfzJiq5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"pF0YMMiMJ6i5SAW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"g2y9s2u9GCLQDII\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"Maszb095Wn6B8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"5GjovZMwp54VNK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"tJubSnADA6OJod\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"VdRjNlnCKBA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"sCaeQPlv7Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"O7LClAmuRe8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"3KuLfZt17HlB6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"StCRr0ouuNID\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"FdAd1rsvzDL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"2T80tv8eVXTiDf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"LySj6pqk2fQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"ScdbX8cRRH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"nqYN9fPlHlbQT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"7LmUOvJ5sFrc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"vDcLuyanw5YTeY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"gMRmMFxHzxQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"SO1eslyGiR1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"13B1EGGa3an7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0y1VrJ6xY4XsB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"DlcuVF61NSVA0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"a55jEYm7vzrs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"OE36FRwUl3v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"NwMDH1GQ6Vf30\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"EQo61jYpLQN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"EmpS8ivMI5c70SP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"K9Fv73oCCacyno\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"rj1Qkecn1uGbk7\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"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_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":679,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json deleted file mode 100644 index b44ea6a2cf..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1a8deecf4e81a3573383a52a8e6961b0.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YBTsRxN6Pqr8aK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Oa09xk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"iyvkk0Seu2U7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"fN6jOmSbskZUzf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"m2RoMTYm55hn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"p8xmcA8IGa4Q2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LzebPQNJtR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6Ju6iZKidt8MT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"UEXRtcRmeahDFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"c7Pu9KGuDuzwJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"hrzaswYVgCBAC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"EhJB1jMOvPH0Iyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1LX1OcqDLKQZc14\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"kVhokGzmayCD0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"isOKzT2DiVi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BOiGtTjLIAR28\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"uMpW0KcpiePUkwh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"JEPODMrNkoHoe64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"OIv2Nji05H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"M05GwyqndpJeu9W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"50daD59Bjqz9Di\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"oU6Nfs5kDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"rqXHxwACh7JNn8h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"ysF1oEaGjjxXR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"mVraSlsYpXib\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"tK6MyLzXK4pJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"wZrQhpiUMf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"49fAHQJVv34gN5A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"8qjjRl9HYBlpej\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"DRliywqGs2jd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"uaxG0qZDTY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ntqa84GRwOPpS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"zqar6ag2wce\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"e5jSslc41xxj85P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"6zi53eSzkeN1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"BZmy4M7Mzk7OrqJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"CQEE7WBWhGa2FO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"u6jqamx7Bc4B1Gk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"NpbMaltmFLMCFzG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"GQtbxC3PmMIUT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"D5NgX1NDEESyB5I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"cu9htl06rI7Uumu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"1D1r8MJnPyzUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"XhlHHwG2itAOLg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"zWOuVbBJjYNgdQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KV6h78MEWYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"z74dA1Vs4a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"UE2Y4oi6hw9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"vTcpt3R0Tbtc8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"0wG8TBo7Pn47\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"EVoldUgXa19\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"G0EsS2abjBQP2m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"qftLEYkwtu6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"Ayqh2RFDeR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"jVTLsEh8Ldcol\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"gKzAtUXFsyDW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"arjfYsKJdXrGiT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"MHYvnIhzeec\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"ax3HZBw0hKL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"8kgL3waEBe7A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6CUjpWCEX9LLr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"QaZX91UGgHT5Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"BL0Ukp8btkog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"OwVxXbrkp91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"fXT73q7JNSpTn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"s6HgY3IFJ7N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"2NB9p6pyoMB7HUa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"fCI1K63bkn30Hq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hl8IrzuLubxPDc\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68cd2516c10c8190a18e3fb76860675a066d738bdda95cee\",\"object\":\"response\",\"created_at\":1758274838,\"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_68cd25179b148190973e353d44d097d0066d738bdda95cee\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_FOmg0cnszW2psWYUtiqvGgCI\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":86,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json new file mode 100644 index 0000000000..eea5d83bd7 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9lU6RI2mIKWZyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"AUbVyN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"BFpCwIcZ0f2SC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xWKZ9cciQmcm2X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"cGMnC1Pc3cmv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WiB0YF0XKSTRU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HsnOpteHju\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rNLBQCxPxLxv6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"lUlIbqTIqa1RUZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"YlwF1B7NNktgh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ybc63xA1urEel\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"tfXfKXTvBytrcku\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"edh8smln6KqL1yy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"E6JdNtwfaF7Bt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"0mDaFrvME7u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Tf1BOweRBd7xF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"U5g2CynL34wrKXD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"eR3Wwa4gjOEBFzt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2Sy9t8FtzD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"VKSlKFNK0bfOLby\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"Ro2yrnVq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"oMxx4y57\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"Dp33AWrbyOGuy7c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"eS4JdPt7Z6WAEh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IJzAV2nePppzCr\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"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_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json deleted file mode 100644 index 959a695819..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_99203bad6675a8e8cc354ad0360f1750.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"aHp4hVE2ymeZSI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8SJM1I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"z8eP45MaPZjsL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"3kb2OU1t3epEFV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"dbw1GzudhXLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yz3y83lf5rTdO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Oo0DH1kI4p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JJFtBwu39xHqD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"cEylPxNpnfXdnX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TPjolTgM3GITW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"3MNDCa2bW6F1m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"k16SLuty9Kb1VWS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ulJTkJHyMcR0zSU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SAeewlEyHPiaO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Cdjdk1LfreJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HOZerBPV3XDXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"c8QJvWnvIwJ00xa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"xARxE5aTug2v4PQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"T3jmMrP349\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"DA9M0soImT71ZhQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"WViaDz7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"44uZSuRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"uC44Xb1gzR3KZcY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jhrhaWBd96hZ6R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4b2jHsF3ZijfRT\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68cd28f0e7508194aaf0357fc58415ce02cb50b538b2c34e\",\"object\":\"response\",\"created_at\":1758275824,\"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_68cd28f18fe0819486206f3b02fd0a5e02cb50b538b2c34e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, updated content

            \\\"}]}\",\"call_id\":\"call_gDxNidmGzKP02rtv8zvlBDiM\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":38,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json new file mode 100644 index 0000000000..3a6f59ac91 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"cdBf1gx1H0DUA0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"2IHsVO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9Hlnxupcw3B6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"l47fzF3qT33iMs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"MYzPNyvxQQFg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CR23byf7uh7vJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"r5oQaF7Us3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"91fgWVR3YE6Cj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ecJE5Livde5E6v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2NKSpcqUX5T8v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"LIPGwOr1G27lS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"zQUAwB7oY8D1Gs1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"QQVwD8Rv6fBzh4B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"CbM051YwYa6Pb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"K5u9mQimTog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BmQPQcrwVHsvL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"ulvjWXmzxtbbmZd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aMKq5RH9ZcyxtpV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"1IM5c4e9ch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"7YUB4yFewigxf0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"BC45voHonFZt8K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"Y0hAMOQ7BXuu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oYSlPTYAzZJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"2tTjcvO9S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"ggHp6kuP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"qPdGxGeJ0nj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"QpHzwUWF3W49A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"WLmiEMDTW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"bRYX5uBzqs6DJw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"X0KmOBI8RGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"BIBx9WXypPR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"KfUnYp5eUeYtM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"m9OwhuLkpZp6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"68fZlMNX5mBF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"pWEYZNXxLDEYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"ijIeHZggavTGAJX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"YYqIXg5Ds1DD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"2wNe4Mf8f1Xx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"w3UuKVF1JrwX3eQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"GUpVsAhh5Axp1pI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"uKFl9dn2jq7Bsv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"TkNNvyMXQU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"WboA90mq9p67gLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"zAGvRf0bz1M6N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"JoUoa93kPQSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"bK3YY3mN2uWG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"LHjnT9W2sT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"z97AwqsS1tK9zKE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"CXKKeEyCaCIb5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"qCXTTHnwvWpG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"WRxRSL4WMu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"8AP6tf3o8eFvh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"gwjaTb4lHCw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"XZdHSlibIxjeOfG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"HdaZSKfKcePe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"kOrsfVGCvuYlftB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"mLm29bfXW3veii\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"k0AZJ8e8144ot1a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"9G8z89LZ7C1DAt3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"VGgCQJh6q6eq7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"lchgwlcf9drQRnK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"anbZk8jsWvTujwG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"hb74SJobCQ3tP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"xi871FdQHAbNyO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"7ucHf8hIrAp5mS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"hcorlL03pdN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"yYHarxakz3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"VMOPdDcsMsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"7E6kPnuatpHi9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"2QZMXc7AqZbb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"wf3U5FIaB7F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"3FMdj1bpjLGneh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"cxbr4mBbhBh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"yD4DxEkban\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"q33VXazmgOLxx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"A0P9HrvmJgc7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"PQGcABlLTkaMbl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KxiVAyO3qTa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"l1twVRkC70n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"XeJcrfa5rt9K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ugorytrDOfEYy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"LcdOuVIu0oIyS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"yB0SkYM7Vu9F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"lhQ4bUtQd1J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"7KSIgvKiviF6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"REtZjg2kCEr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"DhAtHFKEMsxpogj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"TDdnVS0ol7weUY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WxvIRTpsgBrYlL\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":100,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":101,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":102,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"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_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json deleted file mode 100644 index a2ff70037d..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_df20d773f1b621f01e595ac5d44c3e1b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"I'll\",\"logprobs\":[],\"obfuscation\":\"zDMdWjJkoq0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" update\",\"logprobs\":[],\"obfuscation\":\"VuEVGSHZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"9UZMRdTjHC9j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" mention\",\"logprobs\":[],\"obfuscation\":\"qkroAWWT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" to\",\"logprobs\":[],\"obfuscation\":\"QbczfGhXWIHoM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" \\\"\",\"logprobs\":[],\"obfuscation\":\"oQ1P4kBs7EZbQP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"OybC2214l1Bi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"etC7J8VX0Jij\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"kcxlwTRO3OXPUrI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" in\",\"logprobs\":[],\"obfuscation\":\"KfHMkcA8uXH7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"c1a23DEhCXDN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\" document\",\"logprobs\":[],\"obfuscation\":\"VaCETVt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"6KvbKNwuj1w4hdC\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":17,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":18,\"item_id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"msg_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}],\"role\":\"assistant\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":20,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"{\\\"\",\"obfuscation\":\"NeO6uQTzBHeCpU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"operations\",\"obfuscation\":\"y3evGs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"D7fL81QJUQqQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"{\\\"\",\"obfuscation\":\"mUNMPMZM2gVLB5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"type\",\"obfuscation\":\"DjefzmydOcNt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m99PlaJC12zpx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"update\",\"obfuscation\":\"zi6ve2OGvT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JGFrppas2vnO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"id\",\"obfuscation\":\"VhThNcErI4s1YP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"93OnlzwtI9j1n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"ref\",\"obfuscation\":\"eykLESvMSgbb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"3RkyG2wcRPqBPyL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"UoqXPAMPmvkyjOl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QEZcGbMTkolrf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"block\",\"obfuscation\":\"zeJLV010aOj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"AYBRmVTGaNtng\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"<\",\"obfuscation\":\"1BFgkZzuFoXtfXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"mohmplCjR7K9rdh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\">Hello\",\"obfuscation\":\"xLN4oMb6b7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"sPqooFg6vgZuCWH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"4QTq8KknGCA0qN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"span\",\"obfuscation\":\"vNlqXIpoVQFE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"aFwBqyznqSP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-inline\",\"obfuscation\":\"FcRe0X2Th\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-content\",\"obfuscation\":\"L8QjDuHU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-type\",\"obfuscation\":\"FP9gJutWBuy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0ulbQudsqZR3r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"mention\",\"obfuscation\":\"m18B0HAEA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"axPq6pHlNGYtor\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"Q0IvDvfUdzs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-user\",\"obfuscation\":\"Ww2IUYrQSAA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"fLf2NiJLehB9n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Jane\",\"obfuscation\":\"BT21B9GBFXQG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" Doe\",\"obfuscation\":\"5gL8uwiC6Enc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"kn2DBpC5fVmIk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"@\",\"obfuscation\":\"oBE6JVAMMCXVE7T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Jane\",\"obfuscation\":\"vD27VMzxeXv5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" Doe\",\"obfuscation\":\"Gpq7uxVdfe0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"3nZRrLoKMC4kJSC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"QS4H0OmDfJDs3D6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"hcgwnneuzduv1F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"strong\",\"obfuscation\":\"MEQMrMjqbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"GzlXDT3yubPpQHr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"How\",\"obfuscation\":\"LcBaDEhdGbQqX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" are\",\"obfuscation\":\"FLZ9IDrJg4Xf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" you\",\"obfuscation\":\"s1l6nfK7tePN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" doing\",\"obfuscation\":\"DvMdBMLd7f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"?\",\"obfuscation\":\"0TYS8m4o1Mtn2Cw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" <\",\"obfuscation\":\"tRiddnFdBn713D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"span\",\"obfuscation\":\"wsZpDo1gjtBn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" style\",\"obfuscation\":\"Xw3WXIMx4L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"k7aTjlyV8JwHA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"color\",\"obfuscation\":\"CGKWzJ0HfNw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\":\",\"obfuscation\":\"CpunyaiuFEX4ckP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" rgb\",\"obfuscation\":\"4f0DxvblwbYK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"(\",\"obfuscation\":\"2O8QGGRw4Abjwq6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"11\",\"obfuscation\":\"aVDLEjU6jQbjUz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"8a2nQ9sBiRG9cUW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" \",\"obfuscation\":\"OiuqfkTnADDQs2P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"110\",\"obfuscation\":\"bl9TR0qJJsLxU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\",\",\"obfuscation\":\"4wqGKrdFLBbXaHF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" \",\"obfuscation\":\"67mDnl0LxuYSCZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"153\",\"obfuscation\":\"iKc0qPnq16qEN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\");\",\"obfuscation\":\"JUnNbtcsCxMqGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"Btxnsb4pVxOHXs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"D8imZFBILbB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-style\",\"obfuscation\":\"mZOCnPUAIG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-type\",\"obfuscation\":\"aGui8h5YNZk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"n5GwkiD3MWcBv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"text\",\"obfuscation\":\"rGEPF56OPZ3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":95,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"Color\",\"obfuscation\":\"1FDeYtD28me\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":96,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"whMWdVe633f3PE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":97,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"UgqkOU2dU4Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-value\",\"obfuscation\":\"MfsdZwmXi2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"29sWb4WN5QZqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"blue\",\"obfuscation\":\"yUgpxuYTf2Qy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":101,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"OufZ0g4GVpwbNE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":102,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" data\",\"obfuscation\":\"mwLBhKPNgjM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":103,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"-edit\",\"obfuscation\":\"ouUJciP1hat\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":104,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"able\",\"obfuscation\":\"6PQAVPUx42DG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":105,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"hON0YfQgJqWbc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":106,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AD5ahX44Dnl2B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":107,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"This\",\"obfuscation\":\"Jrw53hHD8qkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":108,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" text\",\"obfuscation\":\"qoTTwmuQoh6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":109,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" is\",\"obfuscation\":\"5cNELFwJeri4x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":110,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\" blue\",\"obfuscation\":\"9XyNCaBQSMp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":111,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"!\",\"obfuscation\":\"p9Z9Fq9B0zvy4kn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":116,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"GDbHvdaqgSoKlR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":117,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"delta\":\"]}\",\"obfuscation\":\"f0URPhA0csZdaz\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":118,\"item_id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":119,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":120,\"response\":{\"id\":\"resp_68cd28f826c8819384a8bd52641b319f029d07ff756c2e5c\",\"object\":\"response\",\"created_at\":1758275832,\"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_68cd28f89b548193b00784f559c716f5029d07ff756c2e5c\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"I'll update the mention to \\\"Jane Doe\\\" in the document.\"}],\"role\":\"assistant\"},{\"id\":\"fc_68cd28f947248193bec6244310b6cff3029d07ff756c2e5c\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @Jane Doe! How are you doing? This text is blue!

            \\\"}]}\",\"call_id\":\"call_6KGa6ZofxZvKdzaRoAADQKuJ\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":653,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":123,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":776},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json deleted file mode 100644 index ad6577ea00..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_72da86021e579186b122b75d71128960.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Hx9dSUHKHUmU2D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"HlaWWf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"rIkLbMGIaoLPm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ahgNpUnDtlv9e4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"d70noGgTMn4U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2PELcI04e4lu2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"gwA0VCYvbo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WWmDUdb0hFrDQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"EIdLnwtMItrHdS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CvkRu4cVZtIVo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"U8C0xHYzHCyhI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"VMAgLUTsviv8U89\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"EXk3iXmTG1TOAjL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dXKorqvRplkbH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"W0y16nCEWxl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"o6rtV419K38sR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"J0Fx47CGrVNDsaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"9Mg7wgiriLYgsuX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"qywWInWUDAKZIh2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"eDVnolTZqMg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"cehc0x9vSBjYn1M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"v5eUBT9J6MP5P7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"BQrzF8WmTq6I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"yrD0Q4q4zn6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"lFiIVBHyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"yZyJk8oJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"zHnPABGUPlP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"PQJcjStaRbSd3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"4CdciMASm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"81Y9JkfpOTIATJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"O4XhlTbKY5F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"2axOYRKiktU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"J3RRZgvaZ5ZHI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"zAvZ46x7uYbc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"uilMrD4G4mYu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"4TzAWKtePn5w2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"B6qDQ5pkGmkTb7U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"XFC8nD486BPN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"x8RIaO8ecgGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"FrdQcppOWjhxYcw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"DtIAXtgF6iBUyFj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ttygg74OBI6176\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"9WZfCFlwNM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"XmAw4UzvNPmsmYm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"5xuVEc6RjYuQq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"iLcnLYB3QlG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"a8GHMT9yXpD3Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"yHH8bgJiHJY5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"I3TD4QfjBt3HzdP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ur5I3kzJfiJLjK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"YfVkI3vH63Q9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"iqHcIfiXuQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Rto35TOBzmMB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"2JdYReqHp5Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"BJkqEHXptwx0sth\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"hKbvvNikUZBV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"S5rNwJzZ80YQJva\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"oPme9pvQZKEYZZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Je3xTvMzcgWD3hb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"GLgW1gO7l3oNNW8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"C3zn26SwmkbC1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"J8B9rwbRRoOrLuI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"VWW9FtpX8MFxVBq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"iWHUyKpsvytyf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"nhdcQPHo94PTKw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"E0OOx8FS3JYf8H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"JcbBXZWkEyp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"IooCuZMsRB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"ULa68cdFR3b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Hqai3QhFgw2pE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"qpZtq9TUD1T0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"nZ20if6iHJ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"6E5LQA1lfFyikl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ssoaREFoJ2d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"yWtNteAk94\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0Hy5mtcOR4mXm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"Dqa9hdWh8x95\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"GGVwlqo3GsKTAp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"wq2ID34WAuW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"xOxYbOdFSiJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"iklAa1Z9h4FT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"68jspnBgHIzg7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"husB5PPRCXXO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"hlqhxrWXO0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"X4XPDpvPkyB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"MPPrYkP6N7RO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"7bDcZNILcbD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Snp3vfGDaSnM0B3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"oMoLyPh1vmofoi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"8oD7X2vA7tT90p\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68cd28f232708190bf73be8c04c0577409f78bfd7dbc0893\",\"object\":\"response\",\"created_at\":1758275826,\"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_68cd28f2db0c8190910ba0eed6f5186209f78bfd7dbc0893\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"call_id\":\"call_RyGoYhicdilm6as4bZpHgyd7\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":660,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":109,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json new file mode 100644 index 0000000000..118c636e25 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"3yg3eGE0skVagB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"fWUQ01\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"UMVlM9v4LREo8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tiBPU4pF3wBxIU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"mVkQGBZY2qnO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"B62FiqdFuG8eP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"aMOJbng1NU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HcOs6BRob2m3x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"JGk1ea84f4YZjb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xzn4Pq6RFy0Fe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"g5xSpEcsoKnxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"2oHF5JfVGFs8VBX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Ye8QjZaZgWztiEO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PE2hGpLSuiSmc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Y7YyRbyvN9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yvSBIQt56TX3e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"nLhCc6amwN2nq0E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"o973811Jabg0bI8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"r6GNfocvqYRNGu8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"U3hO6X2Riha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"jq1d7R56zXKHqex\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"rryecWCTMXEBd2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"7CLzL1Sva6pm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ciJ3OJPHJep\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"gNEUViS2i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"NQlIRfaz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"MwGpJKO8tPk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Axg14rGEGfbpw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"7uLhk5tba\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"UlCYIvb6S3pqXf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"wh1brRJc8dv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"Jxd3fh8wbrJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"kl6pzMuzv1NcQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"ormLYrdqIel3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"kU9gsoz7vSKG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"blUhyitxzyhcC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"tRDNlp8M4UlYFq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"szFHmpvg9QGC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"YjXErWdLOlKB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"YU2xOF7C9Dpz8k0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"5zKcrGLTaXjEp6a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"pjODyq0DfJDCYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"vwADa0l00m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6541w4NTxQtHnj5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"YrniXIQQ9TKR3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"mME8sOiTcvY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"wjJMZOo2U4PP3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"O0Ccp2PqEFhG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"DALVzSPaxa9rwch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"1AbSCTxcQwgn2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"SWUlii9pkFfM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"temrrriNap\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"IuAp8hMTcxmIF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"OEZsr4jW0fF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"uqZHNhWW4Ts0NFI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"vO3182G8eSiY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"wBkR9ytB4PkiV8R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"43IwFBfmZdI7Ns\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"qWtfNlsfveg1703\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"nBHHCKmTRjvo7Rh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"TOfLnFffUGwDK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"HMyoptzNujEa948\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"vxRJGymRh8c27Pa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"2eu3u54b4HUs0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"sKX0wmg0apmfmt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"migMovmpUpSEDY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"CLnABAzYeHn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"67jrWAdY1q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"xyOcpMjRsXK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"RqZpvnetn3ieG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"9mboxwAHHl2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"E2KLeaWipy1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"Q9h6DpCWISeVyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xoTiMJN9lyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"WATN0tlEYp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"jVVVRNk29IAQd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"adzrxnC0DwrE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"05nBLFB2wlqGBo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Xy0MukPd6CS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"YSK2IDzFXsX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"6l3wLwm62yD0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"N0K3cdvyCDMAl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"spFl8qQ2KKFFt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"Lo5xWDyqp6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"TxOgeI0Su4s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"j45cLe1Wcjop\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"tO39JGfW0WG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"ctp0QdjoebwXeYb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"aRRopU0CYDmN1L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OjGL9NHbWBf8mY\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"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_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

            \\\"}]}\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json deleted file mode 100644 index 7b18524d21..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_19ae8517bff1915931b5cde2d97220bb.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lNIJgKH7ZAwf53\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"rGeKA3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hzKFB6Bo8ZwFh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"UZum03yvQCmDMg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tqxpOlpLuqjK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2KesUF5ATyUvu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"nFrv6EFG4J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Cz7i9NyNqqLUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"b7keRDKejgGwOk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2KDbRtSdW5lqe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"yRxvLVNOSBA6I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"QXeB58AfC50uuIS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"jayva8btAYqoSXE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"wb1bCK4WfMxcI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ebZTo9VFlYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TipWvVZJoAbq0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"WIpgtagPoBy5ZjA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"r656xidHUP4p9cR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"IpczUoDN0a0NeK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"rWqoN8eVKR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2LzpHmM2Tf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"xmy2UCyXy6VirRz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"O6HbhoibMH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6KE51ToMYZVjbab\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4NpPTj9BoU6KFG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"2nuw1zAimf4y77\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68cd28f5b848819384dfa219cab38f750d23f9b555200cf4\",\"object\":\"response\",\"created_at\":1758275829,\"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_68cd28f66a008193b54affc21fb54cb70d23f9b555200cf4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_fMPpEtqgMpy3U4FE5Ds10m5V\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":649,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":41,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json new file mode 100644 index 0000000000..17adb5dfc9 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"32eKRNUJP4uPFw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"l7KkeQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"roERfNFZLmHga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"y1SOfi5p2VC6Kl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"aY0w87riQPkU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"KNRmVfc0Tvhdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"MjblBcWaBC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ROEFEmETY96Fk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"h5MEbHGbpsAIhH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"D6qIIGLzQIE9f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"fr74TirQk8nYp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"o9ElnTTaXtcg7hR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"YJIcRs8fBXUdFaP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Pkwqd5bJmh1WT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zmGz3NhVVYf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VTgDnGJYwnx3J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"lu7KCF9qq9Ep475\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ZNprBJ5nUk7rq2t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"6XPdfGwiHzjaUS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"TFpJntKhlq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"YUagsTo4i0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"G6thjQcvWVeA3wl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"frYmNOgOPp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"AN7sYzC4bscRLnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"D8Sec8oXbJKhK9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"an1bEeVrBgtcNs\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"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_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json deleted file mode 100644 index b41c00f01f..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_2f4ac50ebee5753c98df3a0ed10cac6b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xF00XhU0d4Mkwf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"wpIhda\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"4nH5yJTFERVtj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"qIQqvTKVImONSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"wQ1HmPbJONH9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zJMPkD9b0NzCi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LciPDUdoYl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4q7bmYjCf5pRW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"GNIq2E1dVodAiP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"66bLXr3KW8vH7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"1X5tt0I1Yk1eV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"KgEKUN0Z5kewCoc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"T7baCFyF1YzTMgq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"iGrok8hzAxYIk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"K8EUmyPE6PI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tQBszMhseYK1b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"GwxwQStqeOzMIP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"dOgQUnZkwVCcvrA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"CWLzDi7ZSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"FqywoyIdWP79EXH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"NKOd443IfMgU4h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"zhSNITVAVH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ehz94XCPO3Ji5Xg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"5UGaoUGSFw1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"lkhzG0jDeQCvqjh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"6P7J8VxPTctQc4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"jJWf67Rr7PmXwg\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd28f43aa48194be8179708a62bacb05a092172ca7555f\",\"object\":\"response\",\"created_at\":1758275828,\"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_68cd28f4c53081949843546f9bcfbdcf05a092172ca7555f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_uvHH7Ljvnn4HWTFAGcGmBMvT\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":656,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":42,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json new file mode 100644 index 0000000000..2a0eff9a04 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Kep2zwtie5Yepa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"rfGD2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"8BO0AoZlDhJUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"yLWFMW4abxhwR6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"9KVJYmcMcR5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"DeryoIE31ZMeP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"xjj7aRmK1I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"5J2GZay2U9UKr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"cmyl19esFxhSkk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"d9Hlkuf5iH2ha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"KyHSNRrXgdgy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"shWygUg2rProHvQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"O6Bg1sVSUPINYDR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PMTuqP7sOnjf1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"jvvbM0a4WIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BnrVsWMgkcSaE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"LnlzqjPw1Ye7Nm3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1JUMmgXKK6TjBdg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"7vQAEvpyJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Zs0IBISvfy5c7qE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ToAwlJJF7bL09O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"JFFNoOhGTA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"vFCB1fs1zWXABhX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"cRQbWYcqexQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"rWbO8sqeEY5y7A5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"pXnehjAaAnueXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"2h1EEyr1EqXsKc\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"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_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":666,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json new file mode 100644 index 0000000000..f2d653da6c --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JP3yw5DpXjGCjy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"HV5dnq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"DmXEcVSGU0mY4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"0nkQP7SDuYp9uX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"amYpJh0CBfid\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"0iJyPZcpVjxez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"T4VTpd5YHL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"nk6o2C4pIOtPa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"tqGEakvrD1MHQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7pdcycJGCStYB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"rNonqbrM9axew\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"5KUCajAKfXldT2q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"vPVBLaeeNXZwB5w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3z0q74n0IgZ9R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"LBo2e6kX77r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dRDQanKBTE00C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"2jXFJCLNC1Upp5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"vlDXucSmk73ZRJf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"DAFnOrrsZxy7lPd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"yCI6EmRnY0Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"FqpWS7ivCOFRUHp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"DBS3T6yLBQmJSs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"xlZNIROWk2U1nU\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":30,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"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_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":491,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":517},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json deleted file mode 100644 index 0127b216ee..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_ff5f616b85fb952da2097208ac01b6cf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"UH8zUByVDCdaskF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"atH1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"TSux3Vla8sCLk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"s6CNpA2DmksYBpS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"9yC8QKHXEQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"LgiKnSHkrgse8h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"8Z48oQ8Bi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"kYkYTmQrb8YtJC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"IHMNTe2lliPhn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"T9v1gLKThX3dtT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"KZk16T0968vd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"qwCxQUiiBk18esY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ns4UDfrx7spYcZZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"3oastoxxcPMyWa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"h5kfZWRe8L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"zb24Y8su4dGHch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"ypMvSdR5MXzz7v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"9NlaHCfB75lH5lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"imT2rpLYmN1igEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"2dpXqFm2P6L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"OmBbku7OOEU2Gv4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"2zwYVo5AWMHX5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"mlP9j7OrNik2g4\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":30,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"JYmiZDFmSYdPDNs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"kOfO5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"i5chP0oqR4hOD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"2ryMpeCi7D3f0rn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"xj5sTjAAKkB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"zdFvBLrSJsol8r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"18Qh2Zbep\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"SmruemIdAQ4zpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"8GPU5vu5MbaKS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"kI2eWmxFfahsWE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"XvQ4rrQIr0HT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"2\",\"obfuscation\":\"fYKszFuP5pedMsb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"WU6O04y4X903cyj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"8z7GrBjoarpi0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"bVORz30qHa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"kX3JLBJEjq3MAz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"vu4LriM2Dj7c4S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"p\",\"obfuscation\":\"0g8AL3Pptxv2e0i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"uzRTNWCf5zT8XtO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"Hallo\",\"obfuscation\":\"Mu05r3ezegz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"dGlVGBz8rhTNDU3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"kQ0S6Dzb5XANGt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"tfIOdfm3aYud0Rs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"XIY6fIaKNXFyyyO\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":1,\"item\":{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68cd2940b3588195af68e836dd7ffd0b0a0536b9c91442d2\",\"object\":\"response\",\"created_at\":1758275904,\"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_68cd2941c5088195941df0f643e0526c0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_TyxhjyEt7YIFukfViS9CMeMb\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd29422ad48195944eb6b6eeb7e7bc0a0536b9c91442d2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hallo

            \\\"}]}\",\"call_id\":\"call_jzcNt7L00Is7hLlcmPo9AnqF\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":480,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":88,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":568},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json new file mode 100644 index 0000000000..aaa7123639 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"w3EQxWSjJdFvha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5S1Wyw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VFR3fYK1ZdJ7l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tDggpZpNsyP0Bn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"IhkcT2I4RZ8f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4ppzQmSLIDgPl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"mg20M2A7Jn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TluxiBjVoafR2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ghVFH7r2FCIRqG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PrHYNRcrD5DwX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FHMcC5DwgnLKz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"FGCHoEgKszFjwHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"s5Hn5T8betJbWcP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"NNvJf5QWikHjN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"cpFnsBw9v7X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"RlCLBKBhw5KwS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"IiWhxqjrm9QqPBy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ava4m8GsF9ffTX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"PBbrCGVcZWJaDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"g48D2xwM2G6y3C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ODyQeIeCSklijqR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"oYM7MGGbNi488n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"q05pCUN146uy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"8RGgS7sQmV8N6h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"8zBTyDyj2ihn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"2GHy1GH0ibWn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hPEIdIH4t4J9D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"q1Iqw40XxJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ud8lgqIbmJXi8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"G5L0q5h1MhlJog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pbw3BShRnPKuF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"0CRuu3VKsJJ78\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"ZHB6MFxuXqd1mEY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"OmfGiDXQZdvucse\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rVl3yMhN20GGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"pU029jvh0qh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ArcbV7HqhEFjx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"u9Ct5Dw34zBplGy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"Veg9UHmCd7ImLA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"VPWQqJMaVUuINV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"MRJWmOOGKvyegH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"lTM3o2g5b34b9Dw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"R3Df6gRfahSd7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"F8p4yStMoNY6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"eNcncMIjhkCGUrm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"vdE6fuop0nVmHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"XOSyUJwWD7BSGA\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"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_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":411,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":467},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json deleted file mode 100644 index 4e0a13c01b..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_66322c56af18dc5c6b2e74db37e03fb4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

            I need to buy:

            \\\"},{\\\"block\\\":\\\"

            Apples

            \\\"},{\\\"block\\\":\\\"

            Bananas

            \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"aISRAJ6HwbqdrYN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"Z8F17\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"qKX0EumMh49SR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"JQvRUK9frpRTupI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"Vawo3jDq1C3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"oxNAMBzBIMBkbS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"IAukBtbAM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"glhjGY6j7eBG0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"N7Y9xXIaIpCAp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"CyKpveM1HyyDAg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"6VquENsoelD4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"Rn2DKwjE0GE4ndE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"7Hx8blOwIQFapCC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"TyW13iJo9gVDV7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"eshkIhuBZj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"1WyAo94JSoWRI5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"q8aEewyg9a6X3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ZiCoJ7gI09XehZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"hlNageaIwd6KqG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"Dfa9LBXHyvSbXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ma6UqFqeFPdOE2U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"ImAx9osr6W4wfM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"GDpmssPQvS58\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"R7YpSSMq6DVmfkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9nrMUHWO88SfSL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"QYqNZ0PGQyK1SK\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"}]}\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":35,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"b9nk3lxlnamoVhw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"operations\",\"obfuscation\":\"XUskt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":[\",\"obfuscation\":\"mCFhRP70taceA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"{\",\"obfuscation\":\"op46HBaWJCnj8iM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"type\",\"obfuscation\":\"AyjRf6Oyn3t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"QKATvCRhoA9cy8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"update\",\"obfuscation\":\"8aEMeTSbq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"qkHkgTn6l7bPNF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"id\",\"obfuscation\":\"ARqWwGUndJ2mw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"55OYvYRS6YxOdE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"ref\",\"obfuscation\":\"YRR8Jjig67Ra\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"3\",\"obfuscation\":\"uT4yLvvVbp24kv7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"$\",\"obfuscation\":\"HwqV6mj6zLMvJzL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\",\",\"obfuscation\":\"APzdr2r5yjhm8k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"block\",\"obfuscation\":\"r6vG5VshUq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\":\",\"obfuscation\":\"NhqarilWr4GeQi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"<\",\"obfuscation\":\"ES4kopYbLQaE5o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"ul\",\"obfuscation\":\"sqDJlUdZlr1ipu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"><\",\"obfuscation\":\"WUGwWMRc2MfIa2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"li\",\"obfuscation\":\"NBNOB9VEClKHXU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\">\",\"obfuscation\":\"ZUthsPT2pXAydr8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"Ban\",\"obfuscation\":\"LwH2PoSXEWGi0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"anas\",\"obfuscation\":\"iEP8EEStYApv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\",\"obfuscation\":\"jDu8Wgc6XjvQnM3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"\\\"}\",\"obfuscation\":\"67mz9A1VbJFENB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"]\",\"obfuscation\":\"fpqcxH24OcF869N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"delta\":\"}\",\"obfuscation\":\"8LKrFmLI1F68pnw\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":67,\"item_id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"output_index\":1,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":68,\"output_index\":1,\"item\":{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":69,\"response\":{\"id\":\"resp_68cd28fc62348197afd4a8db5dcb476f00ebda5b88e34068\",\"object\":\"response\",\"created_at\":1758275836,\"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_68cd28fd45348197a41bcfd5cebb62aa00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
            • Apples
            \\\"}]}\",\"call_id\":\"call_X7YypxDoZsdfl1AgB4EGMHcj\",\"name\":\"applyDocumentOperations\"},{\"id\":\"fc_68cd28fd90b48197ad2ddec5208d703a00ebda5b88e34068\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
            • Bananas
            \\\"}]}\",\"call_id\":\"call_rUOtJPAaZbwHPjoVXbfd2bby\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":400,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":498},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json new file mode 100644 index 0000000000..03aa501450 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"a6oEisxFS5JKVs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"r1Cgh6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"toyuskCFIf6YO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"knTxGq5bq3vYbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Bd75kJtNFB3H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SRy65zMfmvkPW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"N4qCxNPhrx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"butW6XuUHpfwu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"qQmIhRUQgkFUTz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"36uto4A12sdg8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"a3YQM7ljanFAM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"oM3MP5wzT9mj4Wm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"o7j8gP4gKPkPI6R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"oGK3q68BGOB2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"crzyWrjSE6G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VVufKaUNRLWA4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"QvphG4ONOKCvSWk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"HSHHONW5E64P2GX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"tIooPkgV4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"pBC6gCkA3WgA7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"UtXd7bZddap0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"RaqiSNbxAF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"jH8qsyRRwwc6Kag\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"R6vcrG8hCz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"WMg5xV4CqLZRaL0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Q6hwQQSBw1Z3b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"909uditRpk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"13DhgtPF8O342\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"zmnulk0bdix8heo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"WvFLuGKTaO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"CONHPkb1Nc6Eikg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"3trShZFR63kocs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"MjDjAAvmluOrJ0\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":38,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"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_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":708},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json new file mode 100644 index 0000000000..cc20b41eb1 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"S9gsDHljgQVaw6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"hifwRV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"B9blyqJKnfiI6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DHJ2C5J0yC4ahw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"YOvgHLuBaZVb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GsRA4OyxHjIAK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"b7r8QzVlng\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HdX7OeY8LQ3p7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"hGPumKlQfdXaVc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"fHeeQuVAFFbrq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"4cHnkaGo2hQGu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zxXzoS98fLJg0l0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1uZ05PG2hxbP14B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"0wMn1ei4eoPgr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"o5vwormgvOi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HzK3Y6QyxJ8tI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"cfdqZ2zhCKU7Q9P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Ma7Pw1V2czcEplF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"qFwjTW81QY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"XcvdiIrDAYu3X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"PZWBpXG4Xg2V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"gfbZlBIEMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"TiDJ7gwJs9uAmzK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"f7BkNJbyOV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"4jJACskTzpmZqF7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"0qgkEzsPZB7ZV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"Hello\",\"obfuscation\":\"lc493SOd6tV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"KKUpBsiujj7YTB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"GdezCDPFqQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"D30IINd4ZkXtwMD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"32VEb7MRajjFWT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"YuD62tu7CY1PZo\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":37,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":38,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":39,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"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_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":696},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json new file mode 100644 index 0000000000..a27d6c1cd6 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"zQz6iGebOhroRO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Z42Z0G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"rz762ARi2xlyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"QFWFfDWbKLgcGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"G2fnIqHFeG0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"paWUok9xueQeT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"1PRhCMcEy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6TMZzKMS9gulX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"i3IEM1czHkmYeJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"lcsYLpDFmReov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ZOa2XkXV4sEiv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"fBlOXhO5jB4HANv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"6JKCFCaigDjhbWH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"vYQLN2xl6oY0h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"QebVKbWG6CW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5F3egQyaUgzU5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"1dlmZx79v8vDAY7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"KFCEEtMUMHmmHno\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"7IZn6EBRtwWQoCa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"cef4wUtV2tWMP3E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"F7SW9hswHg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"5hkt0qM6BEeso\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"bcqAHYNIBQ1PGd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"kCsyyBzVa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"FgquKiD3q5adGkL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"qqKCiNUjGL4N6r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Jd0CqwODCHPTV9\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"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_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":703},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json deleted file mode 100644 index 39ba9d0876..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_7a047262ac7b92d2c5c967abff011b99.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"SjKwlvKZcFwrCuq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"operations\",\"obfuscation\":\"EZC7c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"GObhMOzBHg1Sz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"{\",\"obfuscation\":\"EYPIs4FOXXkn3Rm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"type\",\"obfuscation\":\"2TyF9UgdjnP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"9Kqh8fUJdl5nrn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"update\",\"obfuscation\":\"DEaC4zNPr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"THBIBbvBZmJ8Dx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"id\",\"obfuscation\":\"RepDNfQgY8Kh3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"uVeyjvh9BhHMbt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"ref\",\"obfuscation\":\"YFJQQZwSnSFn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"hM7kPuvzJt3EFS1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"qUtfWbsatk6a8Td\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\",\",\"obfuscation\":\"Y8ZmkVCl75rFKt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"block\",\"obfuscation\":\"gyNeAdHp16\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\":\",\"obfuscation\":\"TLXkjdjCiZSRi0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"<\",\"obfuscation\":\"1Zy3dAhrW1OL26\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"IEKEg0bPwwbAguG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"Kqi6409bpnAUF8m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6AEwjO9UnOCzXbv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"m7wZiuKyRf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"v1xAiE5CJSsRm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"U8ykenAUu0dNiHS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"wEw3eKZsdC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"0rfEm1A30atfqd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"LWH5Lq0nSQC8TX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"]\",\"obfuscation\":\"2Z3ZSdw0stv2l6w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"mBYPxphYTnJTYB3\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68cd28efc8ac819089f1c353993fdfa00cef1024375ff68f\",\"object\":\"response\",\"created_at\":1758275823,\"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_68cd28f053f081908113bb2e117307730cef1024375ff68f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            What's up, world!

            \\\"}]}\",\"call_id\":\"call_yAsDBazCZve2aqAdh5t5J24n\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":662,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":58,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":720},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json new file mode 100644 index 0000000000..5281ae5d3f --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2F0iy4WkYsay3N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"KT8DGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"WdHo5mUzyzxOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lNDM89u5jAiuki\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"z7FXoRpKEw7b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Ota8xR5iSULBJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"qWxMGjjyZ4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"UnGQcskchj9g6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"dTCyI9OCnryD61\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XO6yP94bIiSFl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"J2AEnuHjN3dms\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"NZVLO9gkrDuCJXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"DwJ7oSh57RtMTsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DoSLQBw8aDePC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"UEsvwGzw8Ca\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iRxPowQFE2kMx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"oIzknJxXJiiST7m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"kcqxLFNadZ5jwvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6aghmhJdV46ZSp3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"CZMBgOjuvz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"7BWkcssYM3YVO9a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"fXPCLPyewW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"qKFyFZOk2KY7R98\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"3sI0kNiQFdVNx7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"9YDiyAX27y9JFG\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"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_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json deleted file mode 100644 index 6d66047f9c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_6fcee8488932f8a8d476c5712bf705f6.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            Hello, @John Doe! How are you doing? This text is blue!

            \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

            Hello, world! Bold text. Link.

            \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"auto\",\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"1MfPMMpB1kItuS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"qVTFbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fJfSNAaF4kDZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sVRqaRE4K9jao4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"75InAGUGskLM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"C1NTNwgAWYgYv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Ds5pwXw7wv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DNPq7xO47QzKp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wT1fRr4xPifkX1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"uQnjHNzxG3jli\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"kt3Assgo3LqfN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"ofsCbfMcp90Bqix\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Xq2n48FRQjWcq8E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ocmKPh60k6deo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"FXNBt8GDIVZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TD4kA3ldXvwoe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vmYnl24cWPqGxJc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"qgjpKWVBdRht8WW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"RfQxrigDWPuzJji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"fYcqbEx3qE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"RZB5gradw2zmwwB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"2pxD2v2E3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"v7Oepe16Q5YOtSG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"bbtI0KZdAwLcoS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WGO4YL47VbfO8M\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68cd290d56288195b90d3324ca20e3790033263b8c7fc5ac\",\"object\":\"response\",\"created_at\":1758275853,\"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_68cd290e04408195b6ad6e45c993370c0033263b8c7fc5ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"}]}\",\"call_id\":\"call_MjL4PDus1gYwarLXEZFit4Y0\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"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\":651,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":39,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts index 2971a2b71d..e7c5a214f4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts +++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts @@ -130,26 +130,19 @@ describe("Models", () => { (params.stream ? "streaming" : "non-streaming") + (params.generateObject ? " + generateObject" : "") })`, () => { - generateSharedTestCases( - { - streamToolsProvider: htmlBlockLLMFormat.getStreamToolsProvider({ - withDelays: false, - }), - transport: new ClientSideTransport({ - model: params.model, - stream: params.stream, - objectGeneration: params.generateObject, - _additionalOptions: { - maxRetries: 0, - }, - }), - }, - // TODO: remove when matthew's parsing PR is merged - { - textAlignment: true, - blockColor: true, - }, - ); + generateSharedTestCases({ + streamToolsProvider: htmlBlockLLMFormat.getStreamToolsProvider({ + withDelays: false, + }), + transport: new ClientSideTransport({ + model: params.model, + stream: params.stream, + objectGeneration: params.generateObject, + _additionalOptions: { + maxRetries: 0, + }, + }), + }); }); } }); From cd63ec56402fdb2e68cff848b27f0e66bad3f351 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 25 Sep 2025 09:08:14 +0200 Subject: [PATCH 57/68] update examples and tests --- examples/09-ai/01-minimal/.bnexample.json | 1 - examples/09-ai/01-minimal/src/App.tsx | 41 +----- examples/09-ai/02-playground/.bnexample.json | 6 - examples/09-ai/02-playground/README.md | 4 +- examples/09-ai/02-playground/src/App.tsx | 133 +++--------------- .../09-ai/02-playground/src/data/aimodels.ts | 2 + .../03-custom-ai-menu-items/.bnexample.json | 2 - .../09-ai/03-custom-ai-menu-items/src/App.tsx | 40 +----- .../04-with-collaboration/.bnexample.json | 1 - .../09-ai/04-with-collaboration/src/App.tsx | 42 +----- .../09-ai/05-manual-execution/.bnexample.json | 1 - examples/09-ai/05-manual-execution/README.md | 2 +- .../.bnexample.json | 1 + .../README.md | 2 +- .../index.html | 0 .../main.tsx | 4 +- .../package.json | 0 .../src/App.tsx | 23 +-- .../src/getEnv.ts | 0 .../tsconfig.json | 0 .../vite.config.ts | 0 .../.bnexample.json | 0 .../README.md | 0 .../index.html | 0 .../main.tsx | 0 .../package.json | 0 .../src/App.tsx | 5 +- .../src/getEnv.ts | 0 .../tsconfig.json | 0 .../vite.config.ts | 0 packages/xl-ai-server/.env.example | 11 +- packages/xl-ai-server/package.json | 7 +- packages/xl-ai-server/src/index.ts | 12 +- .../src/routes/model-playground/index.ts | 91 ++++++++++++ .../src/routes/objectGeneration.ts | 63 +++++++++ packages/xl-ai-server/src/routes/regular.ts | 38 +++++ ...kPersistence.ts => serverPromptbuilder.ts} | 5 +- .../xl-ai-server/src/routes/vercelAiSdk.ts | 95 ------------- packages/xl-ai/.env.example | 7 + ...k_1_2b1987665a8c6b76ea1cc84255389571.json} | 4 +- ...)_1_d09f092a3a86410797b84afbe6a05773.json} | 4 +- ...)_1_ca2502e6ccea5088da25c3f548a88adc.json} | 4 +- ...)_1_97ed001b6f5aed92d99361bc27ca0de9.json} | 4 +- ...)_1_83b238d8e21398ee970fac58c746fe19.json} | 4 +- ...k_1_138de1ba18f0c4a7c084805a95d8aced.json} | 4 +- ...)_1_e8b5b0d45734575f7ba8e685f6787aca.json} | 4 +- ...)_1_1ac8c5c60083d88192ef7e84254cb786.json} | 4 +- ...)_1_a33718ee9e8c30a7679da0e2ea5443bf.json} | 4 +- ...)_1_9b1a71da901951950261005a76c3444a.json} | 4 +- ...k_1_d64b87442b874d6c9d4a16dcc4f0df14.json} | 4 +- ...)_1_acd39fdc6762628fe6f6f97d96d70a78.json} | 4 +- ...)_1_3912ffdff061476f701b59e0f28a5515.json} | 4 +- ...)_1_f047b5323417dfe603d6f28a0f063aa2.json} | 4 +- ...)_1_6e56df97b3441430062e0b5d979d53c9.json} | 4 +- ...k_1_787274f40054195631a7e1b7f70b88f0.json} | 4 +- ...)_1_ac04492f6c52be72c3dc24214a0cf744.json} | 4 +- ...)_1_5b51dd620d4b53f36159ec97780b2929.json} | 4 +- ...)_1_17d834e2d1cae83d1da0998fdfb46c08.json} | 4 +- ...)_1_fded5061f67d6e01b6704bcaf1181daa.json} | 4 +- ...h_1_c859fc3e363e6b44c406982880adeaf8.json} | 4 +- ...on_1_a721c27bc0944c3390dbcf6cbc4aa30d.json | 15 ++ ...on_1_ae989a416fa1cb51342f1da4c5bbe105.json | 15 -- ...h_1_fc80a600d06d9b0a834b3a8dc062d077.json} | 4 +- ...n_1_ea6525e3996561d49f3baaa53e5f4367.json} | 4 +- ...h_1_a6ed8e1b1d7287f11052e60d21aa3c61.json} | 4 +- ...on_1_3f688e4336780f36c03fe2e06fb38ae1.json | 15 ++ ...on_1_c6fb82e817b9dad69fb7d7369cac5784.json | 15 -- ...h_1_2ac4e99d05838a4666b65cfe9ffceee9.json} | 4 +- ...n_1_dafc9c956b17f814f2e5daf2effc4612.json} | 4 +- ...k_1_24119724ddeddbe1d724375ad7546eef.json} | 4 +- ...k_1_fd0a1c180a2d6c7165823af96ca7a444.json} | 4 +- ...k_1_5c60f0de80e4a010dcf6e7b2f534b1d7.json} | 4 +- ...k_1_9ee58319810833bcc30596aa06091958.json} | 4 +- ...g_1_327facc19973ed5bf5dfbb06bc842f58.json} | 4 +- ...k_1_68d51d1950b2878e08616f9effbee616.json} | 4 +- ...k_1_1acc3cfa3a758ee4118f48b99e56f7b5.json} | 4 +- ...t_1_9158921bdd72e8f26eed1d4a3ccff6a4.json} | 4 +- ...t_1_a2946c73d9c3eeca81e4b4b08213a8a2.json} | 4 +- ...n_1_91c94c8501e2f1d5d25c8e9c360dd3d1.json} | 4 +- ...e_1_adde6c9d6144449d4c436ed39a9afcb1.json} | 4 +- ...rk_1_1990cfafdbe6915cc301ba24ba6477c3.json | 15 -- ...rk_1_4d2b9b00dc36b2bb12aae561adde829e.json | 15 ++ ...on_1_06ade1c91064a7b257315d7cfb3dae1c.json | 15 ++ ...on_1_d3744e6f58b758ff270777a78212936f.json | 15 -- ...t_1_24881d7683d6ecbd852f58f6580259f4.json} | 4 +- ...op_1_1c9a4f955e0248798e87ab2412de660d.json | 15 ++ ...op_1_7557f4e0b1168c9cfa85cc2949d3483e.json | 15 -- ...xt_1_57abff3f1cf681ccc8006b74bf065746.json | 15 -- ...xt_1_9e3a8c2b7c0c40aa89c4b52ccf040007.json | 15 ++ ...)_1_d4c19bfff5993efff243e799e4055cc9.json} | 4 +- ...)_1_e31071ae9ad80a23786ec0afc5106c32.json} | 4 +- ...n_1_efc8d37a125c48a5d0af15ecaf8e4b20.json} | 4 +- ...st_1_3ba9845d9c519b43ddbadaddb122d431.json | 15 ++ ...st_1_8f32e048b79fef7ba196203c0790ac1f.json | 15 -- ...t_1_4f6fdb800f1928aed2629f707b95b0da.json} | 4 +- ...p_1_b25dd6e47055e54d58f1fd1f18feb14d.json} | 4 +- ...t_1_de3f09510d3c3eee14653fe5799dbae7.json} | 4 +- ...e_1_d805af33ab12e1bf8f2cb1a055a91fbd.json} | 4 +- ...g_1_3b802465d0bbbdbbcb387b14492eefcc.json} | 4 +- ...k_1_1138449389739970ddab00e2ca2b4bca.json} | 4 +- ...k_1_2f40ee8072a0c34e771a2bd001d04b3a.json} | 4 +- ...t_1_3d19c192afee48b2656b6bdf3ac80415.json} | 4 +- ...t_1_88d6bccbefaf007c2c02e7e007c0f70b.json} | 4 +- ...n_1_89cf6c28cb2ec992330f7c1bdc342068.json} | 4 +- ...e_1_b300195a352d5bddf97a0136eeb314e6.json} | 4 +- ...k_1_008db1a44c8ee4e4d98c2e62c05f1906.json} | 4 +- ...n_1_9a1800c42b72be41038a25622ff00709.json} | 4 +- ...t_1_0463e82390d623aec168d4e483a8e7c1.json} | 4 +- ...p_1_cf6b0ebb12aa86b848af40e9fa5aa4c6.json} | 4 +- ...t_1_2b8a7aa1c2a0945eb657e1784120dabc.json} | 4 +- ...)_1_7f14399291525650d7f05c5015dd3b59.json} | 4 +- ...)_1_710f89bc66a6352e1c21328e600f2536.json} | 4 +- ...n_1_d2ee0ac3b245b97f7a730d85a4575ac3.json} | 4 +- ...t_1_d2eeb79d3f7120d2c9d698e3b82c7362.json} | 4 +- ...t_1_e22ef915ccf69ed6d2eb9f1a04b86c20.json} | 4 +- ...p_1_6d4c550d09a7bfdb440308f277b85a11.json} | 4 +- ...t_1_2448cba67be91338d1977d4a980761a6.json} | 4 +- ...e_1_88fade9a250bf912d8d65f9db17e6de7.json} | 4 +- ...g_1_67c4abf409c5217946a8fd26353f3d5c.json} | 4 +- ...k_1_4d1645603f58ac95cefa5802e9d0b576.json} | 4 +- ...k_1_8235f32b241ce454e355284db306f2b5.json} | 4 +- ...t_1_1e7e3f801e8b2fcad2e947f25b842d59.json} | 4 +- ...t_1_06951fbd3511111eb460efd853b4c6ee.json} | 4 +- ...n_1_d27b598add3108097cd76a3113395221.json} | 4 +- ...e_1_3e742ef6a27c2a70d6a34483f81b80cd.json} | 4 +- ...k_1_3157ee5ddce8f578c94b14a1d8ee0694.json} | 4 +- ...n_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json} | 4 +- ...t_1_d2aedab8bc5dae6b29a5dd2da56165d7.json} | 4 +- ...p_1_fddbbf8781b8c27f9e51a3f0183f370c.json} | 4 +- ...t_1_350896c5ea1c2ae3930e8300d37eb670.json} | 4 +- ...)_1_da57da0afcca08a77da5df430ef1db17.json} | 4 +- ...)_1_717f43f6e3302767b191ed31d11b1dd6.json} | 4 +- ...n_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json} | 4 +- ...t_1_03c3d437686de6faba00429649340a81.json} | 4 +- ...t_1_dd58f52c343818059aa71a9676a172d2.json} | 4 +- ...p_1_a4f7c3617705406313b619c566afef36.json} | 4 +- ...t_1_9b630368d36a8a4420b20bd1e82e455d.json} | 4 +- ...e_1_5da70d5932f66c0ba6f5b15bbb05f68e.json} | 4 +- ...g_1_ec9d93709e473574521d55108aa27f8f.json} | 4 +- ...k_1_6b7b58db82605ee0f2fe5146738274dd.json} | 4 +- ...k_1_4fa98468d00af0302fb35faba6aa2823.json} | 4 +- ...t_1_e761f6071dd9550f02555f17668007d5.json} | 4 +- ...t_1_57bc2951494344f4cd0062fefce14e5f.json} | 4 +- ...n_1_88263a5a62758f9c809abbab15d1c4c7.json} | 4 +- ...e_1_a68854dc4dee1520292cf8b8816d3bf1.json} | 4 +- ...k_1_44bcd73901e9f2eef1a454db1dd3a05d.json} | 4 +- ...n_1_89aa084ced0d3526355fa9ec0a7a0f38.json} | 4 +- ...t_1_3f251996dcb01d2a4adcb6b548554cc5.json} | 4 +- ...p_1_61b231ae85994a3eec1c2eaabb2b3e80.json} | 4 +- ...t_1_3fd6871badc2f924056864cd76a571c0.json} | 4 +- ...)_1_728e83ee8b26541816af7dcf417e127b.json} | 4 +- ...)_1_abd0a85b8c45cfa0b4449a382dc81602.json} | 4 +- ...n_1_c0b30a449a94314760b815a202ee6f64.json} | 4 +- ...t_1_cfbaa99fe0298f4754b6bdd81c0a9601.json} | 4 +- ...t_1_a560a1761f87da8f3bdb7b42357ba4ec.json} | 4 +- ...p_1_d959d9e97f6cf99760b26b7d17c11244.json} | 4 +- ...t_1_649d6a7338cc6b674c4b4c38184c1037.json} | 4 +- ...e_1_9cbb96117eed2b41fee6c0802fe00bb2.json} | 4 +- .../api/formats/json/errorHandling.test.ts | 17 +-- .../xl-ai/src/blocknoteAIClient/client.ts | 74 ++-------- .../clientside/ClientSideTransport.ts | 29 ---- packages/xl-ai/src/testUtil/testAIModels.ts | 20 ++- packages/xl-ai/vite.config.ts | 4 +- pnpm-lock.yaml | 19 ++- 164 files changed, 641 insertions(+), 791 deletions(-) rename examples/09-ai/{06-server-execution => 06-client-transport}/.bnexample.json (87%) rename examples/09-ai/{06-server-execution => 06-client-transport}/README.md (79%) rename examples/09-ai/{06-server-execution => 06-client-transport}/index.html (100%) rename examples/09-ai/{06-server-promptbuilder => 06-client-transport}/main.tsx (80%) rename examples/09-ai/{06-server-execution => 06-client-transport}/package.json (100%) rename examples/09-ai/{06-server-execution => 06-client-transport}/src/App.tsx (88%) rename examples/09-ai/{06-server-execution => 06-client-transport}/src/getEnv.ts (100%) rename examples/09-ai/{06-server-execution => 06-client-transport}/tsconfig.json (100%) rename examples/09-ai/{06-server-execution => 06-client-transport}/vite.config.ts (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/.bnexample.json (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/README.md (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/index.html (100%) rename examples/09-ai/{06-server-execution => 07-server-promptbuilder}/main.tsx (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/package.json (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/src/App.tsx (97%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/src/getEnv.ts (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/tsconfig.json (100%) rename examples/09-ai/{06-server-promptbuilder => 07-server-promptbuilder}/vite.config.ts (100%) create mode 100644 packages/xl-ai-server/src/routes/model-playground/index.ts create mode 100644 packages/xl-ai-server/src/routes/objectGeneration.ts create mode 100644 packages/xl-ai-server/src/routes/regular.ts rename packages/xl-ai-server/src/routes/{vercelAiSdkPersistence.ts => serverPromptbuilder.ts} (95%) delete mode 100644 packages/xl-ai-server/src/routes/vercelAiSdk.ts create mode 100644 packages/xl-ai/.env.example rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json => Add heading (h1) and code block_1_2b1987665a8c6b76ea1cc84255389571.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json => add a list (end)_1_d09f092a3a86410797b84afbe6a05773.json} (50%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json => add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json} (59%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json => add a new paragraph (end)_1_97ed001b6f5aed92d99361bc27ca0de9.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json => add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json} (56%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json => Add heading (h1) and code block_1_138de1ba18f0c4a7c084805a95d8aced.json} (67%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a list (end)_1_338994884cfc874503546888764609a0.json => add a list (end)_1_e8b5b0d45734575f7ba8e685f6787aca.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json => add a new paragraph (empty doc)_1_1ac8c5c60083d88192ef7e84254cb786.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json => add a new paragraph (end)_1_a33718ee9e8c30a7679da0e2ea5443bf.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json => add a new paragraph (start)_1_9b1a71da901951950261005a76c3444a.json} (73%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json => Add heading (h1) and code block_1_d64b87442b874d6c9d4a16dcc4f0df14.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json => add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json => add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json => add a new paragraph (end)_1_f047b5323417dfe603d6f28a0f063aa2.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json => add a new paragraph (start)_1_6e56df97b3441430062e0b5d979d53c9.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json => Add heading (h1) and code block_1_787274f40054195631a7e1b7f70b88f0.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json => add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json => add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json => add a new paragraph (end)_1_17d834e2d1cae83d1da0998fdfb46c08.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json => add a new paragraph (start)_1_fded5061f67d6e01b6704bcaf1181daa.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json => add and update paragraph_1_c859fc3e363e6b44c406982880adeaf8.json} (52%) create mode 100644 packages/xl-ai/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_a721c27bc0944c3390dbcf6cbc4aa30d.json delete mode 100644 packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json => add and update paragraph_1_fc80a600d06d9b0a834b3a8dc062d077.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json => add paragraph and update selection_1_ea6525e3996561d49f3baaa53e5f4367.json} (73%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json => add and update paragraph_1_a6ed8e1b1d7287f11052e60d21aa3c61.json} (62%) create mode 100644 packages/xl-ai/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_3f688e4336780f36c03fe2e06fb38ae1.json delete mode 100644 packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json => add and update paragraph_1_2ac4e99d05838a4666b65cfe9ffceee9.json} (61%) rename packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json => add paragraph and update selection_1_dafc9c956b17f814f2e5daf2effc4612.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json => delete first block_1_24119724ddeddbe1d724375ad7546eef.json} (65%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json => delete first block_1_fd0a1c180a2d6c7165823af96ca7a444.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json => delete first block_1_5c60f0de80e4a010dcf6e7b2f534b1d7.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json => delete first block_1_9ee58319810833bcc30596aa06091958.json} (78%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json => clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json => drop mark and link and change text within mark_1_68d51d1950b2878e08616f9effbee616.json} (59%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json => drop mark and link_1_1acc3cfa3a758ee4118f48b99e56f7b5.json} (65%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json => modify nested content_1_9158921bdd72e8f26eed1d4a3ccff6a4.json} (56%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json => modify parent content_1_a2946c73d9c3eeca81e4b4b08213a8a2.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json => plain source block, add mention_1_91c94c8501e2f1d5d25c8e9c360dd3d1.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json => standard update_1_adde6c9d6144449d4c436ed39a9afcb1.json} (60%) delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_4d2b9b00dc36b2bb12aae561adde829e.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_06ade1c91064a7b257315d7cfb3dae1c.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json => styles + ic in source block, replace content_1_24881d7683d6ecbd852f58f6580259f4.json} (63%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_1c9a4f955e0248798e87ab2412de660d.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_9e3a8c2b7c0c40aa89c4b52ccf040007.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json => styles + ic in target block, add mark (paragraph)_1_d4c19bfff5993efff243e799e4055cc9.json} (57%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json => styles + ic in target block, add mark (word)_1_e31071ae9ad80a23786ec0afc5106c32.json} (61%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{translate selection_1_3e1e8046704f4c1272001e1f1002f592.json => translate selection_1_efc8d37a125c48a5d0af15ecaf8e4b20.json} (55%) create mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json delete mode 100644 packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json => update block prop and content_1_4f6fdb800f1928aed2629f707b95b0da.json} (60%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block prop_1_9e2953494168bd54125bdfba22ba90f4.json => update block prop_1_b25dd6e47055e54d58f1fd1f18feb14d.json} (58%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json => update block type and content_1_de3f09510d3c3eee14653fe5799dbae7.json} (62%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json => update block type_1_d805af33ab12e1bf8f2cb1a055a91fbd.json} (60%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json => clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json} (74%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json => drop mark and link and change text within mark_1_1138449389739970ddab00e2ca2b4bca.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link_1_27ea0e2007440ced1773d35273014e75.json => drop mark and link_1_2f40ee8072a0c34e771a2bd001d04b3a.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json => modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json} (73%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json => modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json} (73%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json => plain source block, add mention_1_89cf6c28cb2ec992330f7c1bdc342068.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json => standard update_1_b300195a352d5bddf97a0136eeb314e6.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json => styles + ic in source block, remove mark_1_008db1a44c8ee4e4d98c2e62c05f1906.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json => styles + ic in source block, remove mention_1_9a1800c42b72be41038a25622ff00709.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json => styles + ic in source block, replace content_1_0463e82390d623aec168d4e483a8e7c1.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json => styles + ic in source block, update mention prop_1_cf6b0ebb12aa86b848af40e9fa5aa4c6.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json => styles + ic in source block, update text_1_2b8a7aa1c2a0945eb657e1784120dabc.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json => styles + ic in target block, add mark (paragraph)_1_7f14399291525650d7f05c5015dd3b59.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json => styles + ic in target block, add mark (word)_1_710f89bc66a6352e1c21328e600f2536.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{translate selection_1_db456b037057f990036a9dbe4c7f0119.json => translate selection_1_d2ee0ac3b245b97f7a730d85a4575ac3.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json => turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block prop and content_1_f90a6f351669841e970de61ba1f65964.json => update block prop and content_1_e22ef915ccf69ed6d2eb9f1a04b86c20.json} (76%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json => update block prop_1_6d4c550d09a7bfdb440308f277b85a11.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json => update block type and content_1_2448cba67be91338d1977d4a980761a6.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type_1_67b84d717ff0d339705097fd3776d332.json => update block type_1_88fade9a250bf912d8d65f9db17e6de7.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{clear block formatting_1_e36e05c66a1610414db2b182e5838630.json => clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json} (64%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json => drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json => drop mark and link_1_8235f32b241ce454e355284db306f2b5.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{modify nested content_1_fce88de162f505469f329e0963496770.json => modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json => modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json => plain source block, add mention_1_d27b598add3108097cd76a3113395221.json} (64%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{standard update_1_80d1c8e8d1c2656834de79b388f2344a.json => standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json => styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json => styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json} (58%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json => styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json => styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json => styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json} (55%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json => styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json => styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json => translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json => turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json} (60%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{update block prop and content_1_9beca226d02b25d743b53bc046843d40.json => update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json => update block prop_1_a4f7c3617705406313b619c566afef36.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{update block type and content_1_559ac20931643831f47c84f41daab0bb.json => update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/{update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json => update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{clear block formatting_1_184b822ea13903701153170335d38a3f.json => clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json => drop mark and link and change text within mark_1_6b7b58db82605ee0f2fe5146738274dd.json} (67%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json => drop mark and link_1_4fa98468d00af0302fb35faba6aa2823.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json => modify nested content_1_e761f6071dd9550f02555f17668007d5.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{modify parent content_1_25a7b376cf9a40be2786f79865156598.json => modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json => plain source block, add mention_1_88263a5a62758f9c809abbab15d1c4c7.json} (63%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json => standard update_1_a68854dc4dee1520292cf8b8816d3bf1.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json => styles + ic in source block, remove mark_1_44bcd73901e9f2eef1a454db1dd3a05d.json} (54%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json => styles + ic in source block, remove mention_1_89aa084ced0d3526355fa9ec0a7a0f38.json} (58%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json => styles + ic in source block, replace content_1_3f251996dcb01d2a4adcb6b548554cc5.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json => styles + ic in source block, update mention prop_1_61b231ae85994a3eec1c2eaabb2b3e80.json} (54%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json => styles + ic in source block, update text_1_3fd6871badc2f924056864cd76a571c0.json} (53%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json => styles + ic in target block, add mark (paragraph)_1_728e83ee8b26541816af7dcf417e127b.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json => styles + ic in target block, add mark (word)_1_abd0a85b8c45cfa0b4449a382dc81602.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json => translate selection_1_c0b30a449a94314760b815a202ee6f64.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json => turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json} (59%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json => update block prop and content_1_a560a1761f87da8f3bdb7b42357ba4ec.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json => update block prop_1_d959d9e97f6cf99760b26b7d17c11244.json} (52%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json => update block type and content_1_649d6a7338cc6b674c4b4c38184c1037.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json => update block type_1_9cbb96117eed2b41fee6c0802fe00bb2.json} (69%) diff --git a/examples/09-ai/01-minimal/.bnexample.json b/examples/09-ai/01-minimal/.bnexample.json index d5446bfa9b..546fecaf6b 100644 --- a/examples/09-ai/01-minimal/.bnexample.json +++ b/examples/09-ai/01-minimal/.bnexample.json @@ -7,7 +7,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/01-minimal/src/App.tsx b/examples/09-ai/01-minimal/src/App.tsx index 63d0c51f5b..e78d2b0af8 100644 --- a/examples/09-ai/01-minimal/src/App.tsx +++ b/examples/09-ai/01-minimal/src/App.tsx @@ -1,4 +1,3 @@ -import { createGroq } from "@ai-sdk/groq"; import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; @@ -15,45 +14,17 @@ import { import { AIMenuController, AIToolbarButton, - ClientSideTransport, createAIExtension, - createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; +import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; -// Optional: proxy requests through the `@blocknote/xl-ai-server` proxy server -// so that we don't have to expose our API keys to the client -const client = createBlockNoteAIClient({ - apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", - baseURL: - getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai/proxy", -}); - -// Use an "open" model such as llama, in this case via groq.com -const model = createGroq({ - // call via our proxy client - ...client.getProviderSettings("groq"), -})("llama-3.3-70b-versatile"); - -/* -ALTERNATIVES: - -Call a model directly (without the proxy): - -const model = createGroq({ - apiKey: "", -})("llama-3.3-70b-versatile"); - -Or, use a different provider like OpenAI: - -const model = createOpenAI({ - ...client.getProviderSettings("openai"), -})("gpt-4", {}); -*/ +const BASE_URL = + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; export default function App() { // Creates a new editor instance. @@ -64,10 +35,10 @@ export default function App() { }, // Register the AI extension extensions: [ - // TODO: too many layers of indirection? createAIExtension({ - transport: new ClientSideTransport({ - model, + transport: new DefaultChatTransport({ + // URL to your backend API, see example source in `packages/xl-ai-server/src/routes/regular.ts` + api: `${BASE_URL}/regular/streamText`, }), }), ], diff --git a/examples/09-ai/02-playground/.bnexample.json b/examples/09-ai/02-playground/.bnexample.json index 8f794c4905..546fecaf6b 100644 --- a/examples/09-ai/02-playground/.bnexample.json +++ b/examples/09-ai/02-playground/.bnexample.json @@ -7,12 +7,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/google": "^2.0.11", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/openai-compatible": "^1.0.13", - "@ai-sdk/groq": "^2.0.16", - "@ai-sdk/anthropic": "^2.0.9", - "@ai-sdk/mistral": "^2.0.12", "zustand": "^5.0.3" } } diff --git a/examples/09-ai/02-playground/README.md b/examples/09-ai/02-playground/README.md index 8f8e51b415..9a40ee10da 100644 --- a/examples/09-ai/02-playground/README.md +++ b/examples/09-ai/02-playground/README.md @@ -1,8 +1,8 @@ # AI Playground -The AI Playground example shows how to customize different options of the AI Extension such as model type and streaming mode. +Explore different LLM models integrated with BlockNote in the AI Playground. -Change the configuration, the highlight some text to access the AI menu, or type `/ai` anywhere in the editor. +Change the configuration, then highlight some text to access the AI menu, or type `/ai` anywhere in the editor. **Relevant Docs:** diff --git a/examples/09-ai/02-playground/src/App.tsx b/examples/09-ai/02-playground/src/App.tsx index b17ab4467b..a180746de5 100644 --- a/examples/09-ai/02-playground/src/App.tsx +++ b/examples/09-ai/02-playground/src/App.tsx @@ -1,9 +1,3 @@ -import { createAnthropic } from "@ai-sdk/anthropic"; -import { createGoogleGenerativeAI } from "@ai-sdk/google"; -import { createGroq } from "@ai-sdk/groq"; -import { createMistral } from "@ai-sdk/mistral"; -import { createOpenAI } from "@ai-sdk/openai"; -import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; @@ -22,72 +16,26 @@ import { import { AIMenuController, AIToolbarButton, - ClientSideTransport, createAIExtension, - createBlockNoteAIClient, getAIExtension, getAISlashMenuItems, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; -import { Fieldset, MantineProvider, Switch } from "@mantine/core"; -import { useEffect, useMemo, useState } from "react"; +import { Fieldset, MantineProvider } from "@mantine/core"; +import { useEffect, useState } from "react"; +import { DefaultChatTransport } from "ai"; import { BasicAutocomplete } from "./AutoComplete"; import { getEnv } from "./getEnv"; -// Optional: proxy requests through the `@blocknote/xl-ai-server` proxy server -// so that we don't have to expose our API keys to the client -const client = createBlockNoteAIClient({ - apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", - baseURL: - (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + - "/proxy", -}); -// return the AI SDK model based on the selected model string -function getModel(aiModelString: string) { - const [provider, ...modelNameParts] = aiModelString.split("/"); - const modelName = modelNameParts.join("/"); - if (provider === "openai.chat") { - return createOpenAI({ - ...client.getProviderSettings("openai"), - })(modelName); - } else if (provider === "groq.chat") { - return createGroq({ - ...client.getProviderSettings("groq"), - })(modelName); - } else if (provider === "albert-etalab.chat") { - return createOpenAICompatible({ - name: "albert-etalab", - baseURL: "https://albert.api.etalab.gouv.fr/v1", - ...client.getProviderSettings("albert-etalab"), - })(modelName); - } else if (provider === "mistral.chat") { - return createMistral({ - ...client.getProviderSettings("mistral"), - })(modelName); - } else if (provider === "anthropic.chat") { - return createAnthropic({ - ...client.getProviderSettings("anthropic"), - })(modelName); - } else if (provider === "google.generative-ai") { - return createGoogleGenerativeAI({ - ...client.getProviderSettings("google"), - })(modelName); - } else { - return "unknown-model" as const; - } -} +const BASE_URL = + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; export default function App() { - const [modelString, setModelString] = useState( + const [model, setModel] = useState( "groq.chat/llama-3.3-70b-versatile", ); - const [stream, setStream] = useState(true); - - const model = useMemo(() => { - return getModel(modelString); - }, [modelString]); // Creates a new editor instance. const editor = useCreateBlockNote({ @@ -98,9 +46,9 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - transport: new ClientSideTransport({ - model, - stream, + transport: new DefaultChatTransport({ + // URL to your backend API, see example source in `packages/xl-ai-server/src/routes/regular.ts` + api: `${BASE_URL}/model-playground/streamText`, }), }), ], @@ -135,17 +83,16 @@ export default function App() { useEffect(() => { // update the default model in the extension - if (model !== "unknown-model") { - ai.options.setState({ - transport: new ClientSideTransport({ - model, - stream, - }), - }); - } - }, [model, ai.options, stream]); - // const [dataFormat, setDataFormat] = useState("html"); + // Add the model string to the request body + ai.options.setState({ + chatRequestOptions: { + body: { + model, + }, + }, + }); + }, [model, ai.options]); const themePreference = usePrefersColorScheme(); const existingContext = useBlockNoteContext(); @@ -163,47 +110,9 @@ export default function App() {
            - {/* { - const dataFormat = - value === "markdown" - ? llmFormats._experimental_markdown - : value === "json" - ? llmFormats._experimental_json - : llmFormats.html; - ai.options.setState({ - dataFormat, - }); - setDataFormat(value); - }} - /> */} - - { - setStream(e.target.checked); - }} - label="Streaming" + error={!model ? "Unknown model" : undefined} + value={model} + onChange={setModel} />
            diff --git a/examples/09-ai/02-playground/src/data/aimodels.ts b/examples/09-ai/02-playground/src/data/aimodels.ts index 0e9e57ce22..344f340b3a 100644 --- a/examples/09-ai/02-playground/src/data/aimodels.ts +++ b/examples/09-ai/02-playground/src/data/aimodels.ts @@ -11,6 +11,8 @@ export const AI_MODELS = [ "mistral.chat/mistral-medium-latest", "mistral.chat/ministral-3b-latest", "mistral.chat/ministral-8b-latest", + "anthropic.chat/claude-opus-4-1", + "anthropic.chat/claude-sonnet-4-0", "anthropic.chat/claude-3-7-sonnet-latest", "anthropic.chat/claude-3-5-haiku-latest", "albert-etalab.chat/albert-large", diff --git a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json index 7e5acc4ab7..6a26d7e7b0 100644 --- a/examples/09-ai/03-custom-ai-menu-items/.bnexample.json +++ b/examples/09-ai/03-custom-ai-menu-items/.bnexample.json @@ -7,8 +7,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", "zustand": "^5.0.3" } diff --git a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx index 66b0e86949..19005a17c3 100644 --- a/examples/09-ai/03-custom-ai-menu-items/src/App.tsx +++ b/examples/09-ai/03-custom-ai-menu-items/src/App.tsx @@ -1,4 +1,3 @@ -import { createGroq } from "@ai-sdk/groq"; import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; @@ -16,9 +15,7 @@ import { AIMenu, AIMenuController, AIToolbarButton, - ClientSideTransport, createAIExtension, - createBlockNoteAIClient, getAISlashMenuItems, getDefaultAIMenuItems, } from "@blocknote/xl-ai"; @@ -26,38 +23,11 @@ import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; import { getEnv } from "./getEnv"; +import { DefaultChatTransport } from "ai"; import { addRelatedTopics, makeInformal } from "./customAIMenuItems"; -// Optional: proxy requests through the `@blocknote/xl-ai-server` proxy server -// so that we don't have to expose our API keys to the client -const client = createBlockNoteAIClient({ - apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", - baseURL: - (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + - "/proxy", -}); - -// Use an "open" model such as llama, in this case via groq.com -const model = createGroq({ - // call via our proxy client - ...client.getProviderSettings("groq"), -})("llama-3.3-70b-versatile"); - -/* -ALTERNATIVES: - -Call a model directly (without the proxy): - -const model = createGroq({ - apiKey: "", -})("llama-3.3-70b-versatile"); - -Or, use a different provider like OpenAI: - -const model = createOpenAI({ - ...client.getProviderSettings("openai"), -})("gpt-4", {}); -*/ +const BASE_URL = + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; export default function App() { // Creates a new editor instance. @@ -69,8 +39,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - transport: new ClientSideTransport({ - model, + transport: new DefaultChatTransport({ + api: `${BASE_URL}/regular/streamText`, }), }), ], diff --git a/examples/09-ai/04-with-collaboration/.bnexample.json b/examples/09-ai/04-with-collaboration/.bnexample.json index 308005b9b3..4ec3d5849f 100644 --- a/examples/09-ai/04-with-collaboration/.bnexample.json +++ b/examples/09-ai/04-with-collaboration/.bnexample.json @@ -7,7 +7,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx index 4faf0ef5e7..6ffbf301d4 100644 --- a/examples/09-ai/04-with-collaboration/src/App.tsx +++ b/examples/09-ai/04-with-collaboration/src/App.tsx @@ -1,4 +1,3 @@ -import { createGroq } from "@ai-sdk/groq"; import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; @@ -15,9 +14,7 @@ import { import { AIMenuController, AIToolbarButton, - ClientSideTransport, createAIExtension, - createBlockNoteAIClient, getAISlashMenuItems, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; @@ -28,9 +25,13 @@ import * as Y from "yjs"; // eslint-disable-next-line import/no-extraneous-dependencies import { EditorView } from "prosemirror-view"; +import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; import "./styles.css"; +const BASE_URL = + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; + const params = new URLSearchParams(window.location.search); const ghostWritingRoom = params.get("room"); const ghostWriterIndex = parseInt(params.get("index") || "1"); @@ -56,37 +57,6 @@ if (isGhostWriting) { const ghostContent = "This demo shows a two-way sync of documents. It allows you to test collaboration features, and see how stable the editor is. "; -// Optional: proxy requests through the `@blocknote/xl-ai-server` proxy server -// so that we don't have to expose our API keys to the client -const client = createBlockNoteAIClient({ - apiKey: getEnv("BLOCKNOTE_AI_SERVER_API_KEY") || "PLACEHOLDER", - baseURL: - (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + - "/proxy", -}); - -// Use an "open" model such as llama, in this case via groq.com -const model = createGroq({ - // call via our proxy client - ...client.getProviderSettings("groq"), -})("llama-3.3-70b-versatile"); - -/* -ALTERNATIVES: - -Call a model directly (without the proxy): - -const model = createGroq({ - apiKey: "", -})("llama-3.3-70b-versatile"); - -Or, use a different provider like OpenAI: - -const model = createOpenAI({ - ...client.getProviderSettings("openai"), -})("gpt-4", {}); -*/ - export default function App() { const [numGhostWriters, setNumGhostWriters] = useState(1); const [isPaused, setIsPaused] = useState(false); @@ -111,8 +81,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - transport: new ClientSideTransport({ - model, + transport: new DefaultChatTransport({ + api: `${BASE_URL}/regular/streamText`, }), }), ], diff --git a/examples/09-ai/05-manual-execution/.bnexample.json b/examples/09-ai/05-manual-execution/.bnexample.json index 194d59ac31..4e18c78ab0 100644 --- a/examples/09-ai/05-manual-execution/.bnexample.json +++ b/examples/09-ai/05-manual-execution/.bnexample.json @@ -7,7 +7,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" diff --git a/examples/09-ai/05-manual-execution/README.md b/examples/09-ai/05-manual-execution/README.md index 003f16a00c..74d066cc3e 100644 --- a/examples/09-ai/05-manual-execution/README.md +++ b/examples/09-ai/05-manual-execution/README.md @@ -1,3 +1,3 @@ # AI manual execution -Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor +Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor. diff --git a/examples/09-ai/06-server-execution/.bnexample.json b/examples/09-ai/06-client-transport/.bnexample.json similarity index 87% rename from examples/09-ai/06-server-execution/.bnexample.json rename to examples/09-ai/06-client-transport/.bnexample.json index 546fecaf6b..c50a7c51fc 100644 --- a/examples/09-ai/06-server-execution/.bnexample.json +++ b/examples/09-ai/06-client-transport/.bnexample.json @@ -4,6 +4,7 @@ "author": "yousefed", "tags": ["AI", "llm"], "dependencies": { + "@ai-sdk/groq": "^2.0.16", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", diff --git a/examples/09-ai/06-server-execution/README.md b/examples/09-ai/06-client-transport/README.md similarity index 79% rename from examples/09-ai/06-server-execution/README.md rename to examples/09-ai/06-client-transport/README.md index 867a30affa..7d89392e8e 100644 --- a/examples/09-ai/06-server-execution/README.md +++ b/examples/09-ai/06-client-transport/README.md @@ -1,3 +1,3 @@ -# AI Integration with server LLM execution +# AI Integration with ClientTransport This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor diff --git a/examples/09-ai/06-server-execution/index.html b/examples/09-ai/06-client-transport/index.html similarity index 100% rename from examples/09-ai/06-server-execution/index.html rename to examples/09-ai/06-client-transport/index.html diff --git a/examples/09-ai/06-server-promptbuilder/main.tsx b/examples/09-ai/06-client-transport/main.tsx similarity index 80% rename from examples/09-ai/06-server-promptbuilder/main.tsx rename to examples/09-ai/06-client-transport/main.tsx index 677c7f7eed..661ad4636b 100644 --- a/examples/09-ai/06-server-promptbuilder/main.tsx +++ b/examples/09-ai/06-client-transport/main.tsx @@ -1,11 +1,11 @@ // AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY import React from "react"; import { createRoot } from "react-dom/client"; -import App from "./src/App.jsx"; +import App from "./src/App.js"; const root = createRoot(document.getElementById("root")!); root.render( - + , ); diff --git a/examples/09-ai/06-server-execution/package.json b/examples/09-ai/06-client-transport/package.json similarity index 100% rename from examples/09-ai/06-server-execution/package.json rename to examples/09-ai/06-client-transport/package.json diff --git a/examples/09-ai/06-server-execution/src/App.tsx b/examples/09-ai/06-client-transport/src/App.tsx similarity index 88% rename from examples/09-ai/06-server-execution/src/App.tsx rename to examples/09-ai/06-client-transport/src/App.tsx index 289ddef25c..841725ba5f 100644 --- a/examples/09-ai/06-server-execution/src/App.tsx +++ b/examples/09-ai/06-client-transport/src/App.tsx @@ -1,3 +1,4 @@ +import { createGroq } from "@ai-sdk/groq"; import { BlockNoteEditor, filterSuggestionItems } from "@blocknote/core"; import "@blocknote/core/fonts/inter.css"; import { en } from "@blocknote/core/locales"; @@ -14,17 +15,23 @@ import { import { AIMenuController, AIToolbarButton, + ClientSideTransport, createAIExtension, + fetchViaProxy, getAISlashMenuItems, } from "@blocknote/xl-ai"; import { en as aiEn } from "@blocknote/xl-ai/locales"; import "@blocknote/xl-ai/style.css"; -import { DefaultChatTransport } from "ai"; import { getEnv } from "./getEnv"; const BASE_URL = - (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + - "/vercel-ai-sdk"; + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; + +const model = createGroq({ + fetch: fetchViaProxy( + (url) => `${BASE_URL}/proxy?provider=groq&url=${encodeURIComponent(url)}`, + ), +})("llama-3.3-70b-versatile"); export default function App() { // Creates a new editor instance. @@ -36,14 +43,8 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ - // We define a custom executor that calls our backend server to execute LLM calls - // On the backend, we use the Vercel AI SDK to execute LLM calls - // (see packages/xl-ai-server/src/routes/vercelAiSdk.ts) - - transport: new DefaultChatTransport({ - // Can also use /generateObject for object generation + non-streaming mode - // or /streamObject for object generation + streaming mode - api: `${BASE_URL}/streamText`, + transport: new ClientSideTransport({ + model, }), }), ], diff --git a/examples/09-ai/06-server-execution/src/getEnv.ts b/examples/09-ai/06-client-transport/src/getEnv.ts similarity index 100% rename from examples/09-ai/06-server-execution/src/getEnv.ts rename to examples/09-ai/06-client-transport/src/getEnv.ts diff --git a/examples/09-ai/06-server-execution/tsconfig.json b/examples/09-ai/06-client-transport/tsconfig.json similarity index 100% rename from examples/09-ai/06-server-execution/tsconfig.json rename to examples/09-ai/06-client-transport/tsconfig.json diff --git a/examples/09-ai/06-server-execution/vite.config.ts b/examples/09-ai/06-client-transport/vite.config.ts similarity index 100% rename from examples/09-ai/06-server-execution/vite.config.ts rename to examples/09-ai/06-client-transport/vite.config.ts diff --git a/examples/09-ai/06-server-promptbuilder/.bnexample.json b/examples/09-ai/07-server-promptbuilder/.bnexample.json similarity index 100% rename from examples/09-ai/06-server-promptbuilder/.bnexample.json rename to examples/09-ai/07-server-promptbuilder/.bnexample.json diff --git a/examples/09-ai/06-server-promptbuilder/README.md b/examples/09-ai/07-server-promptbuilder/README.md similarity index 100% rename from examples/09-ai/06-server-promptbuilder/README.md rename to examples/09-ai/07-server-promptbuilder/README.md diff --git a/examples/09-ai/06-server-promptbuilder/index.html b/examples/09-ai/07-server-promptbuilder/index.html similarity index 100% rename from examples/09-ai/06-server-promptbuilder/index.html rename to examples/09-ai/07-server-promptbuilder/index.html diff --git a/examples/09-ai/06-server-execution/main.tsx b/examples/09-ai/07-server-promptbuilder/main.tsx similarity index 100% rename from examples/09-ai/06-server-execution/main.tsx rename to examples/09-ai/07-server-promptbuilder/main.tsx diff --git a/examples/09-ai/06-server-promptbuilder/package.json b/examples/09-ai/07-server-promptbuilder/package.json similarity index 100% rename from examples/09-ai/06-server-promptbuilder/package.json rename to examples/09-ai/07-server-promptbuilder/package.json diff --git a/examples/09-ai/06-server-promptbuilder/src/App.tsx b/examples/09-ai/07-server-promptbuilder/src/App.tsx similarity index 97% rename from examples/09-ai/06-server-promptbuilder/src/App.tsx rename to examples/09-ai/07-server-promptbuilder/src/App.tsx index 6aa1ba2a9c..6b3513ecea 100644 --- a/examples/09-ai/06-server-promptbuilder/src/App.tsx +++ b/examples/09-ai/07-server-promptbuilder/src/App.tsx @@ -25,8 +25,7 @@ import { DefaultChatTransport, isToolOrDynamicToolUIPart } from "ai"; import { getEnv } from "./getEnv"; const BASE_URL = - (getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai") + - "/vercel-ai-sdk"; + getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; export default function App() { // Creates a new editor instance. @@ -42,7 +41,7 @@ export default function App() { // we adjust the transport to not send all messages to the backend transport: new DefaultChatTransport({ // (see packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts) - api: `${BASE_URL}-persistence/streamText`, + api: `${BASE_URL}/server-promptbuilder/streamText`, prepareSendMessagesRequest({ id, body, messages, requestMetadata }) { // we don't send the messages, just the information we need to compose / append messages server-side: // - the conversation id diff --git a/examples/09-ai/06-server-promptbuilder/src/getEnv.ts b/examples/09-ai/07-server-promptbuilder/src/getEnv.ts similarity index 100% rename from examples/09-ai/06-server-promptbuilder/src/getEnv.ts rename to examples/09-ai/07-server-promptbuilder/src/getEnv.ts diff --git a/examples/09-ai/06-server-promptbuilder/tsconfig.json b/examples/09-ai/07-server-promptbuilder/tsconfig.json similarity index 100% rename from examples/09-ai/06-server-promptbuilder/tsconfig.json rename to examples/09-ai/07-server-promptbuilder/tsconfig.json diff --git a/examples/09-ai/06-server-promptbuilder/vite.config.ts b/examples/09-ai/07-server-promptbuilder/vite.config.ts similarity index 100% rename from examples/09-ai/06-server-promptbuilder/vite.config.ts rename to examples/09-ai/07-server-promptbuilder/vite.config.ts diff --git a/packages/xl-ai-server/.env.example b/packages/xl-ai-server/.env.example index 971ce1f729..531ac8a8ef 100644 --- a/packages/xl-ai-server/.env.example +++ b/packages/xl-ai-server/.env.example @@ -1,6 +1,7 @@ TOKEN= -GROQ_API_KEY= -MISTRAL_API_KEY= -OPENAI_API_KEY= -GOOGLE_API_KEY= -MY_PROVIDER_API_KEY= +OPENAI_API_KEY= +GROQ_API_KEY= +ANTHROPIC_API_KEY= +MISTRAL_API_KEY= +ALBERT_ETALAB_API_KEY= +GOOGLE_API_KEY= \ No newline at end of file diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json index f0d2b5a475..ea9bdccf9a 100644 --- a/packages/xl-ai-server/package.json +++ b/packages/xl-ai-server/package.json @@ -47,7 +47,12 @@ "hono": "^4.6.12", "ai": "^5.0.45", "@blocknote/xl-ai": "latest", - "@ai-sdk/openai": "^2.0.23" + "@ai-sdk/google": "^2.0.11", + "@ai-sdk/openai": "^2.0.23", + "@ai-sdk/openai-compatible": "^1.0.13", + "@ai-sdk/groq": "^2.0.16", + "@ai-sdk/anthropic": "^2.0.9", + "@ai-sdk/mistral": "^2.0.12" }, "devDependencies": { "eslint": "^8.10.0", diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts index 7f3ce285d8..f66ef6738e 100644 --- a/packages/xl-ai-server/src/index.ts +++ b/packages/xl-ai-server/src/index.ts @@ -5,9 +5,11 @@ import { cors } from "hono/cors"; import { existsSync, readFileSync } from "node:fs"; import { createSecureServer } from "node:http2"; import { Agent, setGlobalDispatcher } from "undici"; +import { modelPlaygroundRoute } from "./routes/model-playground/index.js"; +import { objectGenerationRoute } from "./routes/objectGeneration.js"; import { proxyRoute } from "./routes/proxy.js"; -import { vercelAiSdkRoute } from "./routes/vercelAiSdk.js"; -import { vercelAiSdkPersistenceRoute } from "./routes/vercelAiSdkPersistence.js"; +import { regularRoute } from "./routes/regular.js"; +import { serverPromptbuilderRoute } from "./routes/serverPromptbuilder.js"; // make sure our fetch request uses HTTP/2 setGlobalDispatcher( @@ -30,9 +32,11 @@ if (process.env.TOKEN?.length) { } app.use("/ai/*", cors()); +app.route("/ai/regular", regularRoute); app.route("/ai/proxy", proxyRoute); -app.route("/ai/vercel-ai-sdk", vercelAiSdkRoute); -app.route("/ai/vercel-ai-sdk-persistence", vercelAiSdkPersistenceRoute); +app.route("/ai/object-generation", objectGenerationRoute); +app.route("/ai/server-promptbuilder", serverPromptbuilderRoute); +app.route("/ai/model-playground", modelPlaygroundRoute); const http2 = existsSync("localhost.pem"); serve( diff --git a/packages/xl-ai-server/src/routes/model-playground/index.ts b/packages/xl-ai-server/src/routes/model-playground/index.ts new file mode 100644 index 0000000000..00a61d1e22 --- /dev/null +++ b/packages/xl-ai-server/src/routes/model-playground/index.ts @@ -0,0 +1,91 @@ +import { createAnthropic } from "@ai-sdk/anthropic"; +import { createGoogleGenerativeAI } from "@ai-sdk/google"; +import { createGroq } from "@ai-sdk/groq"; +import { createMistral } from "@ai-sdk/mistral"; +import { createOpenAI } from "@ai-sdk/openai"; +import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; +import { convertToModelMessages, jsonSchema, streamText, tool } from "ai"; +import { Hono } from "hono"; + +export const modelPlaygroundRoute = new Hono(); + +/** + * This endpoint is used in the AI Playground so we can select different models + * the model string (e.g. "openai.chat/gpt-4o") is sent in the request body + * based on which we use the corresponding AI SDK model + */ +modelPlaygroundRoute.post("/streamText", async (c) => { + const { messages, streamTools, model: modelString } = await c.req.json(); + + const model = getModel(modelString); + + if (model === "unknown-model") { + return c.json({ error: "Unknown model" }, 404); + } + + const result = streamText({ + model, + messages: convertToModelMessages(messages), + tools: { + applyDocumentOperations: tool({ + name: "applyDocumentOperations", // TODO + inputSchema: jsonSchema(streamTools), + outputSchema: jsonSchema({ type: "object" }), + }), + }, + toolChoice: "required", + }); + + return result.toUIMessageStreamResponse(); +}); + +function getProviderKey(provider: string) { + const beforeDot = provider.split(".")[0]; + const envKey = `${beforeDot.toUpperCase().replace(/-/g, "_")}_API_KEY`; + const key = process.env[envKey]; + if (!key || !key.length) { + return "not-found"; + } + return key; +} + +// return the AI SDK model based on the selected model string +function getModel(aiModelString: string) { + const [provider, ...modelNameParts] = aiModelString.split("/"); + const modelName = modelNameParts.join("/"); + + const providerKey = getProviderKey(provider); + if (providerKey === "not-found") { + return "unknown-model" as const; + } + + if (provider === "openai.chat") { + return createOpenAI({ + apiKey: providerKey, + })(modelName); + } else if (provider === "groq.chat") { + return createGroq({ + apiKey: providerKey, + })(modelName); + } else if (provider === "albert-etalab.chat") { + return createOpenAICompatible({ + name: "albert-etalab", + baseURL: "https://albert.api.etalab.gouv.fr/v1", + apiKey: providerKey, + })(modelName); + } else if (provider === "mistral.chat") { + return createMistral({ + apiKey: providerKey, + })(modelName); + } else if (provider === "anthropic.chat") { + return createAnthropic({ + apiKey: providerKey, + })(modelName); + } else if (provider === "google.generative-ai") { + return createGoogleGenerativeAI({ + apiKey: providerKey, + })(modelName); + } else { + return "unknown-model" as const; + } +} diff --git a/packages/xl-ai-server/src/routes/objectGeneration.ts b/packages/xl-ai-server/src/routes/objectGeneration.ts new file mode 100644 index 0000000000..168276736a --- /dev/null +++ b/packages/xl-ai-server/src/routes/objectGeneration.ts @@ -0,0 +1,63 @@ +import { createOpenAI } from "@ai-sdk/openai"; +import { + objectAsToolCallInUIMessageStream, + partialObjectStreamAsToolCallInUIMessageStream, +} from "@blocknote/xl-ai"; +import { + convertToModelMessages, + createUIMessageStreamResponse, + generateObject, + jsonSchema, + streamObject, +} from "ai"; +import { Hono } from "hono"; + +export const objectGenerationRoute = new Hono(); + +/* + * For specific cases where you need to use `generateObject` or `streamObject` (use object generation instead of text streaming) + * you can follow the examples below. Note: most LLMs work better with text streaming. + * + * NOTE: the recommended way to use object generation is to use `streamText` (see regular route). + */ + +const model = createOpenAI({ + apiKey: process.env.OPENAI_API_KEY, +})("gpt-4o"); + +objectGenerationRoute.post("/streamObject", async (c) => { + const { messages, streamTools } = await c.req.json(); + const schema = jsonSchema(streamTools); + const result = streamObject({ + model, + messages: convertToModelMessages(messages), + output: "object", + schema, + }); + + const stream = partialObjectStreamAsToolCallInUIMessageStream( + result.fullStream, + "applyDocumentOperations", // TODO, hardcoded + ); + + return createUIMessageStreamResponse({ stream }); +}); + +objectGenerationRoute.post("/generateObject", async (c) => { + const { messages, streamTools } = await c.req.json(); + const schema = jsonSchema(streamTools); + + const result = await generateObject({ + model, + messages: convertToModelMessages(messages), + output: "object", + schema, + }); + + const stream = objectAsToolCallInUIMessageStream( + result.object, + "applyDocumentOperations", // TODO, hardcoded + ); + + return createUIMessageStreamResponse({ stream }); +}); diff --git a/packages/xl-ai-server/src/routes/regular.ts b/packages/xl-ai-server/src/routes/regular.ts new file mode 100644 index 0000000000..346d3976f5 --- /dev/null +++ b/packages/xl-ai-server/src/routes/regular.ts @@ -0,0 +1,38 @@ +import { createOpenAI } from "@ai-sdk/openai"; +import { convertToModelMessages, jsonSchema, streamText, tool } from "ai"; +import { Hono } from "hono"; + +export const regularRoute = new Hono(); + +/** + * This is the recommended (regular) way to stream text responses from the LLM + * to BlockNote clients + * + * It follows the regular `streamText` pattern of the AI SDK: + * https://ai-sdk.dev/docs/ai-sdk-core/generating-text#streamtext + */ + +// Setup your model +const model = createOpenAI({ + apiKey: process.env.OPENAI_API_KEY, +})("gpt-4o"); + +// Use `streamText` to stream text responses from the LLM +regularRoute.post("/streamText", async (c) => { + const { messages, streamTools } = await c.req.json(); + + const result = streamText({ + model, + messages: convertToModelMessages(messages), + tools: { + applyDocumentOperations: tool({ + name: "applyDocumentOperations", // TODO + inputSchema: jsonSchema(streamTools), + outputSchema: jsonSchema({ type: "object" }), + }), + }, + toolChoice: "required", + }); + + return result.toUIMessageStreamResponse(); +}); diff --git a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts b/packages/xl-ai-server/src/routes/serverPromptbuilder.ts similarity index 95% rename from packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts rename to packages/xl-ai-server/src/routes/serverPromptbuilder.ts index 20fae55edd..775e5c524b 100644 --- a/packages/xl-ai-server/src/routes/vercelAiSdkPersistence.ts +++ b/packages/xl-ai-server/src/routes/serverPromptbuilder.ts @@ -13,8 +13,9 @@ import { } from "ai"; import { Hono } from "hono"; -export const vercelAiSdkPersistenceRoute = new Hono(); +export const serverPromptbuilderRoute = new Hono(); +// Setup your model const model = createOpenAI({ apiKey: process.env.OPENAI_API_KEY, })("gpt-4o"); @@ -45,7 +46,7 @@ async function saveChat({ // follows this example: // https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message -vercelAiSdkPersistenceRoute.post("/streamText", async (c) => { +serverPromptbuilderRoute.post("/streamText", async (c) => { const { id, promptData, streamTools, lastToolParts } = await c.req.json(); const tools = { diff --git a/packages/xl-ai-server/src/routes/vercelAiSdk.ts b/packages/xl-ai-server/src/routes/vercelAiSdk.ts deleted file mode 100644 index 6ed22ad0da..0000000000 --- a/packages/xl-ai-server/src/routes/vercelAiSdk.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { createOpenAI } from "@ai-sdk/openai"; -import { - objectAsToolCallInUIMessageStream, - partialObjectStreamAsToolCallInUIMessageStream, -} from "@blocknote/xl-ai"; -import { - convertToModelMessages, - createUIMessageStreamResponse, - generateObject, - jsonSchema, - streamObject, - streamText, - tool, -} from "ai"; -import { Hono } from "hono"; - -export const vercelAiSdkRoute = new Hono(); - -const model = createOpenAI({ - apiKey: process.env.OPENAI_API_KEY, -})("gpt-4o"); - -vercelAiSdkRoute.post("/generateText", async () => { - // can't easily convert generateText response to stream - // https://github.com/vercel/ai/issues/8380 - throw new Error("not implemented"); - // const { messages } = await c.req.json(); - - // const result = generateText({ - // model, - // messages: convertToModelMessages(messages), - // tools: { - // // add: tool({}), - // }, - // }); - - // return result as any; - // return result.toDataStreamResponse(); -}); - -vercelAiSdkRoute.post("/streamText", async (c) => { - const { messages, streamTools } = await c.req.json(); - - const result = streamText({ - model, - messages: convertToModelMessages(messages), - tools: { - applyDocumentOperations: tool({ - name: "applyDocumentOperations", - inputSchema: jsonSchema(streamTools), - outputSchema: jsonSchema({ type: "object" }), - }), - }, - toolChoice: "required", - }); - - return result.toUIMessageStreamResponse(); -}); - -vercelAiSdkRoute.post("/streamObject", async (c) => { - const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(streamTools); - const result = streamObject({ - model, - messages: convertToModelMessages(messages), - output: "object", - schema, - }); - - const stream = partialObjectStreamAsToolCallInUIMessageStream( - result.fullStream, - "applyDocumentOperations", - ); - - return createUIMessageStreamResponse({ stream }); -}); - -vercelAiSdkRoute.post("/generateObject", async (c) => { - const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(streamTools); - - const result = await generateObject({ - model, - messages: convertToModelMessages(messages), - output: "object", - schema, - }); - - const stream = objectAsToolCallInUIMessageStream( - result.object, - "applyDocumentOperations", - ); - - return createUIMessageStreamResponse({ stream }); -}); diff --git a/packages/xl-ai/.env.example b/packages/xl-ai/.env.example new file mode 100644 index 0000000000..f7f5b2bc6f --- /dev/null +++ b/packages/xl-ai/.env.example @@ -0,0 +1,7 @@ +# only for tests +OPENAI_API_KEY= +GROQ_API_KEY= +ANTHROPIC_API_KEY= +MISTRAL_API_KEY= +ALBERT_ETALAB_API_KEY= +GOOGLE_API_KEY= \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_2b1987665a8c6b76ea1cc84255389571.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_2b1987665a8c6b76ea1cc84255389571.json index 640b734a48..7f3f115776 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_96d0e1517a8bb553eb9b6ee21982497a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/Add heading (h1) and code block_1_2b1987665a8c6b76ea1cc84255389571.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_012Kb5amw4X7zt46ugsJ3uJH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NsF3dRrcByZis6tAf2gFgd\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erenceId\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"os\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ition\\\":\\\"af\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ter\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"blocks\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

            Cod\"} }\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\":\"
            c\"}           }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"onsole.log('\"}  }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"hello world'\"}    }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");\\\"]}]}\"}            }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0     }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":123}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"     }\n\n",
            +    "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01AEtR1JsNCuyX3TGtvsgUSS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}}  }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01GNk3KEiak5uiDDyp4j2PCD\",\"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\":\"{\\\"opera\"}     }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ti\"}       }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": \"}  }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"type\\\":\\\"ad\"}               }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"r\"}     }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eferenceI\"}          }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2\"}        }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"\"}            }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\"}              }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"after\"}              }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"blocks\"}       }\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\":\"h1>Code\"}      }\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\":\",\\\"conso\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le.log\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"('he\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo world');\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"]}]}\"}}\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\":1132,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":123} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d09f092a3a86410797b84afbe6a05773.json similarity index 50% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d09f092a3a86410797b84afbe6a05773.json index faaa99613d..de0a7f3211 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d2f73226dddd06ac91dea952e1a9ee81.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a list (end)_1_d09f092a3a86410797b84afbe6a05773.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
            • item1
            ` is valid, but `
            • item1
            • item2
            ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
            ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

            Hello, world!

            \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

            How are you?

            \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01WqEsawKYAnwnU3RiWMrWdz\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017ZX7PA7FFhbe8ZajRM3oe9\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"add\\\",\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erenceId\\\"\"}}\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\":\"$\\\",\\\"posit\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"fte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oc\"} }\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\":\"
            • Apples\\\",\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ul>
            • Ban\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"anas
            • \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":111} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01VJX6xYYZuwkLfkAs1BPBQp\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01EPUisQQLhSvhkNpN9gRa1T\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\\\"refere\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nceId\"} }\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\":\"\\\"ref2$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"position\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"after\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"cks\"} }\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\":\"
              • Ap\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ples
              • <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/ul>\"} }\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\":\"Bananas
              \\\"]}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":111}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json index a1f22bd985..61d37e8f92 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_49445e3fc77c6a478d0b7a35fc7d5d92.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              \\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01VRzd5N6QHSxhM3prs4bfYL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01CVXVx3GaeZX2PXGiE94Biq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" loo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k great to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"day!<\"} }\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\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":84} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TTpZunpRFo6XMRwFnTab65\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NbuB5m8nLsgaWbJS3AUavp\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

              You lo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ok\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"toda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y!

              \\\"}]}\"} }\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\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_97ed001b6f5aed92d99361bc27ca0de9.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_97ed001b6f5aed92d99361bc27ca0de9.json index 5510b5c0ab..947ce50147 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_dc9cd760b004ff62c03a3dec3ad04dc2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (end)_1_97ed001b6f5aed92d99361bc27ca0de9.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CKWDzQ898wuCGhVoAr4M1q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01JbdwQRBCSbhGc1gDU47BJY\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"add\\\",\\\"refer\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"enceId\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"aft\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ks\\\":[\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>You look \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!\\\"]}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Afzi2hECs4YCeA5Gxd22wu\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LQPWW9Hybdxs1x7XtDM1eE\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"add\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"reference\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\",\\\"posi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tion\\\":\\\"after\"} }\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\":\"blocks\"} }\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\":\"You l\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ook\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"]\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json index 26832e29f6..8d0a34ebc4 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_98aa72bfe8b21fbf73137bdca4c10b2c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01MXpAdMyy1JWMCBczY4wVGJ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016ZrbziXZhCBqSE32zuBEWW\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"ad\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\",\\\"referen\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ce\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"positi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\\\":\\\"before\\\"\"} }\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\":\"s\\\":\"} }\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\":\"You look gr\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eat tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!

              \\\"]}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_011ekxiY9CASdUh5TmWaji9x\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01JsfqfAaQyJkReZoJTkJj2y\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\"\"} }\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\":\"add\\\",\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ferenceId\\\":\"} }\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\":\"\\\",\\\"po\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"sition\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"before\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ocks\\\"\"} }\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\":\"

              You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!

              \\\"]\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_138de1ba18f0c4a7c084805a95d8aced.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_138de1ba18f0c4a7c084805a95d8aced.json index c9e1f5e712..579930a036 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_5d9c47c4909388aa5eb834e520036903.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/Add heading (h1) and code block_1_138de1ba18f0c4a7c084805a95d8aced.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvt2bedntfbaezj53j1e7\"}}\n\ndata: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b1m32skcm\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"},{\\\"blocks\\\":[\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language=\\\\\\\"javascript\\\\\\\"\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d55ee7fb-de60-4077-8669-d632b05588fe\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2fd18a07d5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvt2bedntfbaezj53j1e7\",\"usage\":{\"queue_time\":0.219656376,\"prompt_tokens\":845,\"prompt_time\":0.069583372,\"completion_tokens\":76,\"completion_time\":0.164241172,\"total_tokens\":921,\"total_time\":0.233824544}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-e7321176-1786-4469-8a67-46c47f9ad895\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk0tye04v7p34s86pxrq0\"}}\n\ndata: {\"id\":\"chatcmpl-e7321176-1786-4469-8a67-46c47f9ad895\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1zfedaer2\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003ch1\\\\u003eCode\\\\u003c/h1\\\\u003e\\\",\\\"\\\\u003cpre\\\\u003e\\\\u003ccode data-language='javascript'\\\\u003econsole.log('hello world');\\\\u003c/code\\\\u003e\\\\u003c/pre\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e7321176-1786-4469-8a67-46c47f9ad895\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk0tye04v7p34s86pxrq0\",\"usage\":{\"queue_time\":0.084504521,\"prompt_tokens\":845,\"prompt_time\":0.068739009,\"completion_tokens\":58,\"completion_time\":0.127742835,\"total_tokens\":903,\"total_time\":0.196481844}},\"usage\":{\"queue_time\":0.084504521,\"prompt_tokens\":845,\"prompt_time\":0.068739009,\"completion_tokens\":58,\"completion_time\":0.127742835,\"total_tokens\":903,\"total_time\":0.196481844}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_e8b5b0d45734575f7ba8e685f6787aca.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_e8b5b0d45734575f7ba8e685f6787aca.json index 01e3d684b6..a27356d148 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_338994884cfc874503546888764609a0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a list (end)_1_e8b5b0d45734575f7ba8e685f6787aca.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvsnkeb09661xhxp8444z\"}}\n\ndata: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cr84bwjnp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c7b67a10-53a7-415d-807c-ac1cf6a63568\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvsnkeb09661xhxp8444z\",\"usage\":{\"queue_time\":0.143981598,\"prompt_tokens\":829,\"prompt_time\":0.070478034,\"completion_tokens\":54,\"completion_time\":0.123841596,\"total_tokens\":883,\"total_time\":0.19431963}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-84e55078-3dc6-43cf-ab85-afd649c8edbb\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk0f2fzxskefjmhj9fx7p\"}}\n\ndata: {\"id\":\"chatcmpl-84e55078-3dc6-43cf-ab85-afd649c8edbb\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1db3bk93w\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-84e55078-3dc6-43cf-ab85-afd649c8edbb\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk0f2fzxskefjmhj9fx7p\",\"usage\":{\"queue_time\":0.08498975,\"prompt_tokens\":829,\"prompt_time\":0.067493718,\"completion_tokens\":54,\"completion_time\":0.123861036,\"total_tokens\":883,\"total_time\":0.191354754}},\"usage\":{\"queue_time\":0.08498975,\"prompt_tokens\":829,\"prompt_time\":0.067493718,\"completion_tokens\":54,\"completion_time\":0.123861036,\"total_tokens\":883,\"total_time\":0.191354754}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_1ac8c5c60083d88192ef7e84254cb786.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_1ac8c5c60083d88192ef7e84254cb786.json index a8aa4b2ab0..788ae6fc29 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_2115dc6928012212f947319925cc0ac9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_1ac8c5c60083d88192ef7e84254cb786.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvtjaeb19wycn4taf512q\"}}\n\ndata: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wh2c1ns3s\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-afca20b3-375a-43f1-9f9b-d6e2f2d718f1\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvtjaeb19wycn4taf512q\",\"usage\":{\"queue_time\":0.142698738,\"prompt_tokens\":798,\"prompt_time\":0.066935778,\"completion_tokens\":32,\"completion_time\":0.080420775,\"total_tokens\":830,\"total_time\":0.147356553}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztphc7f0j85995eq2zqryg\"}}\n\ndata: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"00kkp36kc\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztphc7f0j85995eq2zqryg\",\"usage\":{\"queue_time\":0.14394342,\"prompt_tokens\":798,\"prompt_time\":0.066320232,\"completion_tokens\":33,\"completion_time\":0.09610912,\"total_tokens\":831,\"total_time\":0.162429352}},\"usage\":{\"queue_time\":0.14394342,\"prompt_tokens\":798,\"prompt_time\":0.066320232,\"completion_tokens\":33,\"completion_time\":0.09610912,\"total_tokens\":831,\"total_time\":0.162429352}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_a33718ee9e8c30a7679da0e2ea5443bf.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_a33718ee9e8c30a7679da0e2ea5443bf.json index d44c9ba242..33334f104d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_23dd862dafcd7507928655ff9d663c49.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_a33718ee9e8c30a7679da0e2ea5443bf.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvs9teaztj1znsqv69yzc\"}}\n\ndata: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ppj486qqj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-df86c63c-7940-4b69-9df8-bd11547811fd\",\"object\":\"chat.completion.chunk\",\"created\":1758707181,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvs9teaztj1znsqv69yzc\",\"usage\":{\"queue_time\":0.166779493,\"prompt_tokens\":827,\"prompt_time\":0.067672158,\"completion_tokens\":38,\"completion_time\":0.088055458,\"total_tokens\":865,\"total_time\":0.155727616}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-dbde950c-7299-4a7d-819a-96ff8a9014aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk05qey1sp983bm54g0e7\"}}\n\ndata: {\"id\":\"chatcmpl-dbde950c-7299-4a7d-819a-96ff8a9014aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"axzcy4tet\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-dbde950c-7299-4a7d-819a-96ff8a9014aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783439,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk05qey1sp983bm54g0e7\",\"usage\":{\"queue_time\":0.088833993,\"prompt_tokens\":827,\"prompt_time\":0.068264884,\"completion_tokens\":38,\"completion_time\":0.089419435,\"total_tokens\":865,\"total_time\":0.157684319}},\"usage\":{\"queue_time\":0.088833993,\"prompt_tokens\":827,\"prompt_time\":0.068264884,\"completion_tokens\":38,\"completion_time\":0.089419435,\"total_tokens\":865,\"total_time\":0.157684319}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_9b1a71da901951950261005a76c3444a.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_9b1a71da901951950261005a76c3444a.json index 77b6e7bea8..f7fbccae5a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_95680ca6feb571de6a8f6acfdb77b183.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (start)_1_9b1a71da901951950261005a76c3444a.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvrxdeazbhfkeckwrjgd5\"}}\n\ndata: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"5fbnasded\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-03d8a667-c9bc-4a79-b780-52d0d8d9ca20\",\"object\":\"chat.completion.chunk\",\"created\":1758707180,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvrxdeazbhfkeckwrjgd5\",\"usage\":{\"queue_time\":0.167598826,\"prompt_tokens\":827,\"prompt_time\":0.067527601,\"completion_tokens\":38,\"completion_time\":0.094821719,\"total_tokens\":865,\"total_time\":0.16234932}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-4f3f51e3-80d0-4c7f-8586-c93f4e0e6f6c\",\"object\":\"chat.completion.chunk\",\"created\":1758783438,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_adc8919c18\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztjzrmfzxaep2pyt2sbhc3\"}}\n\ndata: {\"id\":\"chatcmpl-4f3f51e3-80d0-4c7f-8586-c93f4e0e6f6c\",\"object\":\"chat.completion.chunk\",\"created\":1758783438,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_adc8919c18\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ekszm6xby\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"before\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4f3f51e3-80d0-4c7f-8586-c93f4e0e6f6c\",\"object\":\"chat.completion.chunk\",\"created\":1758783438,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_adc8919c18\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztjzrmfzxaep2pyt2sbhc3\",\"usage\":{\"queue_time\":0.203541748,\"prompt_tokens\":827,\"prompt_time\":0.068058296,\"completion_tokens\":38,\"completion_time\":0.08582147,\"total_tokens\":865,\"total_time\":0.153879766}},\"usage\":{\"queue_time\":0.203541748,\"prompt_tokens\":827,\"prompt_time\":0.068058296,\"completion_tokens\":38,\"completion_time\":0.08582147,\"total_tokens\":865,\"total_time\":0.153879766}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_d64b87442b874d6c9d4a16dcc4f0df14.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_d64b87442b874d6c9d4a16dcc4f0df14.json index 22bf7622af..0bb7b6f8ec 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_5cb5969256536cfe3360d4c6142e580c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/Add heading (h1) and code block_1_d64b87442b874d6c9d4a16dcc4f0df14.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GywnFORIrVDhal\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sTnNMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"HgJQ63ZV1J2Ov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ohVH5nHarT9Qph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yE6Xb3FJirn9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"E8TdyY6Cj9586\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"S9ErhgY5TaiAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7sxujv22mXZ4N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DTEzXuv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"vZZeMff5q2BRKa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"rLabX0ifg2yps\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ew2HWIkg3XrOv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"W0abyJXCy75Rbm1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"29XGvMd9wMbKFwJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Axh3L07NFW4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"RdmIbd8D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jDM1PZlTRWxRw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"23XBGu2xUn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KPCOBNWOF0iQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"jBpOwGeMPw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"WldU9bHhreG3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"yTZVTYQZPw47fSC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"92L7SgIvEb1ndVL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"xaeJugs6eTHvuV5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gFiRRKaMXOzIJd5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"bCnVNgSNJorV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"zAkOsBKHRhcNGqK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Lp5ZGSncH88pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CH6Bnu3lWEngCIh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"tZZ5e8ROZTPSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"R6c7TUCoKHOIHi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"fFFwoAfIYoQf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"NRIb3Bg7J7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"550xJe7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"k38vD379aecSm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"mioFXQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"hUsGjFx35bDDe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"e0A1inZ2h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"xnznzMOKdp3a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"N1LwcSNGqSK5h3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"FIPVd2RlNWd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"b90a4fYZsi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"8ZgBWto6SGdjF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2fcZy0cT88qm81f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"O1RotYHg8NuHJq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"eHoES9WNrQ4dzjr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"gZVDvdphiY9m0e\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68d3bda4a980819095ec1f88447ad41d06bf94c63d3a9244\",\"object\":\"response\",\"created_at\":1758707108,\"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_68d3bda557dc8190b6ed28c302c9bc2606bf94c63d3a9244\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d109e48194af28a13eee7d8cd400bf99f43c7482b6\",\"object\":\"response\",\"created_at\":1758783441,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d109e48194af28a13eee7d8cd400bf99f43c7482b6\",\"object\":\"response\",\"created_at\":1758783441,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"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_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"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_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EIZFZg0a3nDpIY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"nMgJFW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gd55G30Dnyk22\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fnvmihsT8fVVPK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"96uvVCFq6bHd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3HmPIIWn5juYd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"OPPT4vN4yi2FX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"94s5EV0AHWzD2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"mMLamse\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"VLFDYbXjd6t23S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S6bnscfefwCxv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"lQiUQ5ylSC4M7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"uSfNInPrnmUgzYT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rOYTkLoGV5iXADC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WHdas5WbuQcxe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"cqmDMdI1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"aLeS0WxpSbSGt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"wbxj9LTqFaK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4E036OGgsNIHz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"kPjczadlef\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"v3T0giOy1atf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"EFgFO0Xc2gxYnAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"teVs6A54PbYy1Wu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"OhMyTcDd8TpkJP6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XJ7fpCDd40mgrZg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Code\",\"logprobs\":[],\"obfuscation\":\"5yDG6PUkm785\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"ursXZdyixVjbBBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ampLxmFzmAxDQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"klpFlrAC2kiCD50\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"pre\",\"logprobs\":[],\"obfuscation\":\"inBnovFIXmSnV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"2XvEQ02rtu1WTZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"code\",\"logprobs\":[],\"obfuscation\":\"Y8Vb3ttp4vU9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"vtYHkneJvgp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"-language\",\"logprobs\":[],\"obfuscation\":\"HHMfUVX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"BCPyt3UVDdEcf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"javascript\",\"logprobs\":[],\"obfuscation\":\"mc3cXs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"0dlX4DWWeGOMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"console\",\"logprobs\":[],\"obfuscation\":\"9dvkdEgE2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\".log\",\"logprobs\":[],\"obfuscation\":\"CDbDtRHD3P95\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"('\",\"logprobs\":[],\"obfuscation\":\"MqY897u3ByUMza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"hello\",\"logprobs\":[],\"obfuscation\":\"O35CCA2zLjw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"UdyCgI6C2g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"');\",\"logprobs\":[],\"obfuscation\":\"cdWrWC5AHs2Zg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"l5zmGM1uBqHLb1e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"dWG20wvxbxqz8m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"Bz82R0AhhJCA3oj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"SDnPkn9YUGX0D9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68d4e7d109e48194af28a13eee7d8cd400bf99f43c7482b6\",\"object\":\"response\",\"created_at\":1758783441,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json index c181e5cd27..6188aaf56a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_cf519dc42b5d5ab96892746983e054f5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"A3v3NqFfEn9D5u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"koFNZD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"I3JpjNQp9uyXe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"cOg7c7qeHFXnYW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QbjTZ2Ww78Hj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Fu1n7cHMwZRpU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"aXRBWlO2lv8Ud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9Yhzjl7z7iWFu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"dncrvwR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"9krjlTwq2wRvI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nMT7r7fVeUuID\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"GkAdP8KuWmYf5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Cu8cPQGXDWOy7t5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ccgTLwSmQLVuL6J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"vCKCt0bJHDOAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"paX4stgA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WJFQniEIsEkBO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"co9QM3iepHU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"v4i6ndVm3w04J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"hWCcDQeYsB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"rtiakUnUY9zf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Nsu8LtynZR4JDm8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"MOCxtX5SYOygWJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"b1uphTjOCZT0QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"0MovI8CnzazdgM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yqEJ93HyMKbSCQM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"6fYn3V0B2pI57u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"2poeHryeaJF6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Yxuegn2VjTIarr9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"OukUh4SRIW3r2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SaYOaN9DrPL0Vtm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"vi8uivoUmmsNLO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"0gYkcizkZ4Uezw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"T5iwhxQ90DmgSH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"uxV0EeMlXVe1x2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"6eOJaEv4FquCH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"7ULTn27GvWIC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"sJmk9xy9XUY6hUH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"A1kzjaobQEUnf1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"2zQ0edVAngWxMt5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uyWXHTZhVmKwDa\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68d3bda266a881969b144c98f980952c03858e2d0f78fc97\",\"object\":\"response\",\"created_at\":1758707106,\"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_68d3bda2f9308196a39efc3d30c89af403858e2d0f78fc97\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7cf047c8196af4dedb3d1d0f73d0676329e74b5c2cf\",\"object\":\"response\",\"created_at\":1758783439,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7cf047c8196af4dedb3d1d0f73d0676329e74b5c2cf\",\"object\":\"response\",\"created_at\":1758783439,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"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_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"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_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"49Hr9vhJGX1Dy5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"b68X2n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"NMZH4lcm3lUa1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"aCsnCFtXaW4sdB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"9E90fNTfPaCs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"b6SFLsGkJxcKd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"YncmfzQMZWh51\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"z3nclVHSvUSzv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"rHGQ3Jf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"2wEo7EkIQFM0Pa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0lFG83t2enlb7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"CBijVxjfD2TQw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"lvO1y53tuSDejNh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"OUCp4NnUa5W5R7I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2Q1W3vSeQ5H1k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"I7guEP3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YGChfgsbnptDs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"yGd4RvhRRQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cB1r5muixu56e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"t6iG6MfU6t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"2rHOcQEoxyX2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"I60OWWq39jDWjOC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"zb4YIOfZvD0sQi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"CO4dcFUMZF1We2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"Fxw5foUMnRK1NA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"oQzyn25FuECCQmF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"hbfA278xfJxVXH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"ZuqQiaPdHnY6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"cPZffO3PG2yF9IG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jSCiJj7p1wdF7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"WGlqldW3CoXfSIB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"yGdH3e243NvnWw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"SpzBQAXCUXCtfp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"8bLMcLbHVudTpn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"HYkbYiCO6X82vW7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"JYAjBCdSVlOpU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"HVtp7aengpSK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2ahHSSkBiXbdeGO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"O0tMurlaPQtwr3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"9paQuHj6c6hyjnH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"vZyMQpuAK9YBs3\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68d4e7cf047c8196af4dedb3d1d0f73d0676329e74b5c2cf\",\"object\":\"response\",\"created_at\":1758783439,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json index d286cb632f..f239da856c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_ee1fc8c443fc731bcf2b941528a18d91.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"k1i0yR8zM4y4Gs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"2kv7T2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"uxO1cTcF8fOYs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"GyJvJAtidrmzcP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ms51Lq6hZwHE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RpFj1Q3tdbOgV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XtBMgZcNBG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"TRcLCtT9aK4s7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WymOrauaQwPald\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tnhlJI6aPe382\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O3RhtFMGuwKvd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"XV9RrkJfR631bcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pW0cy9vI4xmr6K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LZdAk00gOtCph\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MagpkIGXevL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Fl6hD86c0Vu1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"PeLsBPiqjUGDsyL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"IogRuWudDO3kYFE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"lqo0XYUU4fy5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"kGm4c7ctYX8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"qPAYYF1YtE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"AEAnMyMm4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"yIGnPjYfKsSBuVu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"5Xmn624oZQDHi3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"XqnUzclGAPWkqG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bda927708197945254c42466c3fc023e605775b340d4\",\"object\":\"response\",\"created_at\":1758707113,\"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_68d3bdaa1f488197a54df96adfd9d72b023e605775b340d4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":586,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":614},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d305508190889ec835751773250bfa6fe27e617b3b\",\"object\":\"response\",\"created_at\":1758783443,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d305508190889ec835751773250bfa6fe27e617b3b\",\"object\":\"response\",\"created_at\":1758783443,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5qyCQmD6LNyZHm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"NR1aao\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"M9Y7D6Ua0rVhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XOPac27XcmbMSu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Ot1WWp2AuD6H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FHf9hQg56yxGk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wSJ9sINvev\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6NBZdV5wtowRb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"a8KDwdhU8Vib32\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WmFmNFSmFnirt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bbKsKliXLhu0e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"maOUKCZDbLSmTz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NKjNtohkVJA71oh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rFCt2O7itzG3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"C6TTEeKrdWE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nSxsUudX8bLIm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AtSsst0UjUjPONf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gFxud1fmg1zDRBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"cECUfT1Ma84Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"QRcP28jhm9M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"KWMe6POTaf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"9sz17rUHq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"qP41TrMjf8QsaQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"7pHXS00r44KxtM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"x7oW3wrJh3cFeK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7d305508190889ec835751773250bfa6fe27e617b3b\",\"object\":\"response\",\"created_at\":1758783443,\"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_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":586,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":614},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_f047b5323417dfe603d6f28a0f063aa2.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_f047b5323417dfe603d6f28a0f063aa2.json index a3dfd9058d..c4e0cac99d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_bdae0c6bc0379d3a2b9ca48556974339.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (end)_1_f047b5323417dfe603d6f28a0f063aa2.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"HAQSbZqfvxsxTV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"GYSji0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"aXuMX2DWWLaDi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"THDLzOKw6P2ctf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gotL9CmEKc3F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ilOHMIcoPD6z6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"oR58c4r4vGDAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4GYxLBpLkTtfc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"DvsJa2S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"ropwIfpWQ9ZOh2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w4wygBOMy1tl8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"KothJH3CiWMk5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ahFFybBFvuqN3qd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"TLUy0v20PDlq1nf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3lyQvXsN356pv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"mXYp2Z6f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FJHQ80xKguvwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"4z7Ac9gA5cG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8kOoDqqqMsr0E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"rAJBg3vwbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"h0z0rZsJuco3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AHQeo1d4CAOt6mh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"U4sp8qNpwhBruYp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"LklHbDvhVarH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"AhGAlQKF7Wh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"HLAPEOZSS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"AsCpk6QfTa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"GL46m8qDnNGGocZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"d71a433h0ekCki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"3de23wna17sQgyu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"S4yzEhCl6l7ub7\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bda08c188197b0f3d2d7c62b77f90e312d801d8fc8a2\",\"object\":\"response\",\"created_at\":1758707104,\"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_68d3bda185a08197a87a62b60c8c2a9a0e312d801d8fc8a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e826f48481938871a249762291aa06b9ff8f151acc02\",\"object\":\"response\",\"created_at\":1758783527,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e826f48481938871a249762291aa06b9ff8f151acc02\",\"object\":\"response\",\"created_at\":1758783527,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"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_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"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_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"c6drK3edF3hOiH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"nr9H28\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"axs82pA58ODl3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"OAyPRFsI7lAgZf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AUMxeVG7eAag\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HMIlk5yuu5CuR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"MB8KflhA0OS79\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7QcGWtw8KMMHF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"FKlASbV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"LSCLStVQ6C6U5z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QGkBa43HDwrtb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FbfflwoKoXxqy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"5WGEqTizNZ42yTo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"EMNoRwe2Erojhuq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"8LmB408S9goTy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"PMkngih0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9hSQSnPunEumt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"OC1gJ4NfxJk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WEX6GtONSYNPo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"9KVTu3tqFP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"HdhQFRSMrKo8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6mIEMZ48qRNFdAS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"pgCNBgMMgTqiPkG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"xVMQ7LCUonoB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"MOqzDszHs33\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"hX3MypEI1p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"nOqxGlNcNP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"YTIac3ov28dZZZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"llotqBPQcj9zks\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"BJ6V5DYmjiaNseS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"1HoOd232cTlVQ9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e826f48481938871a249762291aa06b9ff8f151acc02\",\"object\":\"response\",\"created_at\":1758783527,\"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_68d4e827e37c8193abb0897625825e2406b9ff8f151acc02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_6e56df97b3441430062e0b5d979d53c9.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_6e56df97b3441430062e0b5d979d53c9.json index d0d7cf7e10..c2ea5cb085 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_c2cedd1c149bff876a53867177c0583e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (start)_1_6e56df97b3441430062e0b5d979d53c9.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ST7hmAhxLBWRyW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"p7kiCa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ieKdfuQekD8bA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"WinOYb2xZ2wOgv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"KFHt56kol9uN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"660VyeI4rKuBi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"6AlG1kewudiYG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uQiYKnqxZVCb1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"b3YkaM3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"DPRyxFsOzvh5mL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TJzbBgdbgmu5s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LJzyYXiCcAmT8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"rkoqLKEbP2KGNi6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3BkNCH0sqUK5BnF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QdsJPSck9vcdL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"mZ8Up80E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Cu0KQROaDBB9S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"23EjSQiixO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"suNlAsGZ1KEf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"q0Hwal1vCg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"Fk1KyF4RxqZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"c6B350EPUpMz0D6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FGW1a64mOpcj0Q5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"sMZgVHZb6gV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"J7mgS3JDf6O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"pHVvwZXPOw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"wLOSvGRTFK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"nH8EuPAdQHOznc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"2bHumg9u1Gz74A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"kvFamJ63vIwAWpo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2hudeNiIT88yMK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bd9e91fc8195a7a152507c912da304e832995df3a1a2\",\"object\":\"response\",\"created_at\":1758707102,\"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_68d3bd9f823c8195927e0a3be4458ace04e832995df3a1a2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7cd2d6c819484eaa8624ed4e97f08c082ad346c9447\",\"object\":\"response\",\"created_at\":1758783437,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7cd2d6c819484eaa8624ed4e97f08c082ad346c9447\",\"object\":\"response\",\"created_at\":1758783437,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"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_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"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_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"sYVU3kqFBLigbU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"RHY7Ug\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wJpgGLiQDAbsF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Lei02McACSj5YB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"N4d5ZxWji43A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"CH9u5sX9BXVrV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"DBIz3ehZMUlIg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DJ3dcbsHySSGf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"ubmn1s0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"0YOO5Tgt6voRcy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3XjKokYkQKrqz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sxkYsHcjW0YZW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"dL4gWeHV9YRBPLc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ldvzuNJ0P2X39IJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"X3bsVYu7V9Fhd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"7yiMy5DP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S5rkcBN00wAwc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"e6wPpSFSNV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"BGhXcigrTrSgn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"XkXR0YmsaJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"0vQe561mXeij\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"L51yPAKAP8zk9ib\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LK2mSQPYuLDXDFT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"zvZfG1pnXAfC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"A82eQJC4A1P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"YnciPEhSjN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"KD85Dmo48p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"amD0PUQUUhN8MGR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"sBYLXtlnfNzb6S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"VY11jV7RzgMGMnW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RHLq7rCCubKMmp\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e7cd2d6c819484eaa8624ed4e97f08c082ad346c9447\",\"object\":\"response\",\"created_at\":1758783437,\"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_68d4e7cdbe208194b0095d7c0a327a2b08c082ad346c9447\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":614,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":648},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_787274f40054195631a7e1b7f70b88f0.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_787274f40054195631a7e1b7f70b88f0.json index 4adbb2ff16..fca945662f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_0523740bd337e9bda9dfe06f8d02e4be.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/Add heading (h1) and code block_1_787274f40054195631a7e1b7f70b88f0.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"at the end of doc, add a h1 heading `Code` and a javascript code block (block, not inline style) with `console.log('hello world');`\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mNPNQT94A6KRAN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Z1Tzon\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"0KnOuo9Tq6s5y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"TYc1SASzrIJOtD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"nwCtK3SrK1im\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"v0YwD7bQbhrCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"39lw16q0QcwYv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6NlFYGdCVL7iC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"lmlIyHd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"22WqhvpEJmwYfw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"OKW5kLaXsqDJd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"sJWD89HHz1BLp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"eDn9cGe0nacR2cu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ISUjweRZPHbf6O4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"yEXZASelTbYZn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"NIGZ2aZJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jJ0treXb7f44a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"bgVfFsY9CUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"tgMzDdHDrtNVT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"pxZ54jnj2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"h0t37hakS8oa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"7WppjpHi7zgja7Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"lCGVHQY6JViavJa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"Gz8nhg5h62TK8Lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ZOHnn92TvETAb1p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"Code\",\"obfuscation\":\"2SSoixAODto7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"4xsNSVQ1MbSM0kB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"eUvgiZxmVcIqa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vYGwOi1r01R2F37\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"pre\",\"obfuscation\":\"h2oygSHiekyi6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"644XYomIpSpT1Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"code\",\"obfuscation\":\"UDrpSxEbOGnE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"1teUyUaTH64\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"-language\",\"obfuscation\":\"Rpqmme9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"htRZDyXDoUJDn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"javascript\",\"obfuscation\":\"2B1c3d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"nNHskjyDh7uZY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"console\",\"obfuscation\":\"gzOqfsSOW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\".log\",\"obfuscation\":\"5FBHafQQ1Q16\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"('\",\"obfuscation\":\"Yr5jtlUGUifghB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"hello\",\"obfuscation\":\"6AkDAO88yEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"tsTpYQ0OWW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"');\",\"obfuscation\":\"4XXmTTpo5S27l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"qgaNvfqktcoZMdt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"XQ7WPvyWJkdwFz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"g6SJsGI14Jzz6Lf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BXPBP0qUJRpm6z\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68d3bdce09e88194bd2ddd16bed9dd82023d3e5e9430f3cf\",\"object\":\"response\",\"created_at\":1758707150,\"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_68d3bdce841c8194838dbd18f1da5e01023d3e5e9430f3cf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"call_id\":\"call_O0h479J2fOVLUzzhiqiaqbGF\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":569,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7af7dac8190a74530a69cb68f170289e878de34b6ac\",\"object\":\"response\",\"created_at\":1758783407,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7af7dac8190a74530a69cb68f170289e878de34b6ac\",\"object\":\"response\",\"created_at\":1758783407,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_X4U9TjMOwTocVPpy8TRfvDbt\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"BAcgfErFARrtvr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"suwgrP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"K2zLW61V9kMP3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"fLxBgL7pwvIxUd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"EyW0cLutUe2x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"V9jiDLCjepBCn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"a314LOqjMT8T3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"IFqOLUEOsS54F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"9kN7iEs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"hqfWtccw649iTU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"FF4eQgsQ53tsF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Sh0DsL9xL2vCY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"FqOv35LiETlMphd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"YzUM3lltyLFZVFD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"g50GMiv8QgCG5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"71JOwO7n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CAtmGuGT9iAHo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"zJD0RiBYOeJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"jftvM3Zkkpe0K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"2arbWxqgA5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"pk2E44FV3ESX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"lAJYydCKTbiLoeg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"zh8QPiRWKnc5KGC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"AWZ0wiSJ909duR7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Ps0NYlKHcddesjq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"Code\",\"obfuscation\":\"zYsDc4upWkco\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"6q50GJidTVfzngB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"wRmoXj47QTgeo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"bAzhiq24rddW8UR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"pre\",\"obfuscation\":\"TriErLydJdb5o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"z0ZK2hST24uhMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"code\",\"obfuscation\":\"jsWIWrUpvGUu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"lXoQhx6SXpS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"-language\",\"obfuscation\":\"rmJCbXb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"uxfedY9NdAmhy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"javascript\",\"obfuscation\":\"wpVwuK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"3RlGrRxGbby2B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"console\",\"obfuscation\":\"EpCTwCYS7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\".log\",\"obfuscation\":\"mu2hCMxvltSn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"('\",\"obfuscation\":\"Kefy1kKVsP0jAf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"hello\",\"obfuscation\":\"KgJcXjXOWbn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"RvhFTBLTDS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"');\",\"obfuscation\":\"tNx5rOzkleGTZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"i3YvgHoXfn0zCz2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"S6tAdeztXGzXDa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"2Xa05dKDS6ebCLQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"FbVmo0LZBIActO\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"call_id\":\"call_X4U9TjMOwTocVPpy8TRfvDbt\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68d4e7af7dac8190a74530a69cb68f170289e878de34b6ac\",\"object\":\"response\",\"created_at\":1758783407,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              Code

              \\\",\\\"
              console.log('hello world');
              \\\"]}]}\",\"call_id\":\"call_X4U9TjMOwTocVPpy8TRfvDbt\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":569,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json index 2432b61bd5..d73b1c06c3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_31cf7da48755c7f8f58270eef4fefcdf.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a list with the items 'Apples' and 'Bananas' after the last sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"iGrz7yphswd3wH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"QbQtQs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"a8OqIrMZEBCnj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tY2UEQFGIRAg4u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"LNjY4bsypjdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nQHDXVJFth5pK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"LqGuprYr1jbDs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"x5yYfwXXD8Vh5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"GKxv2hE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"o69dAogCrz5z5s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jjFoRIUFUXbxK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"sbYOqygk3kjfZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"u8Mj4V4b5iZXRXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pgHak2R19piWqvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8hQlz4jqgEuQL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"3sLRgxSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5689994pQ3aBB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"NfU4aai9WnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"YwmtL7qTbbYpi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"KKwbq51Ys4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"b71xUN4l6Rcb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"iW0XdLRZ3jUxioJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"WzbiuJpgtUfTeW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"yzmfj6TEMvHVGx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"tkLw9bU2vP1lSo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6eCMolF6qHsMCjS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"XDONTpaJt0rcjl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"i9T6PcLUMCj8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"y8m974Xu7Q5LhEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"J096nIJU5HGUa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"fAOqRHmPH9rNXmX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"jnpFDJCrTykbWE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"ssus9rJ69ciIrM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"mSMypbYOeVr3Z3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"uOYIpcnVdmDQJ3L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"j7O24CrrkFrMS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"0Caku3AXkeEj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"59wTuhg1lYcEJNh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"5vjLvIcABOuR9F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"F0T6J3MOx0iRa5o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"hRiynlFtDvtg3T\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d3bdccd8a08194aed972f844779bb4008d1f3552903112\",\"object\":\"response\",\"created_at\":1758707148,\"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_68d3bdcd4a508194bf5fbfd5bd76a4cb008d1f3552903112\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"call_id\":\"call_Or4v3vGunYMEhvzcNU6q44Hf\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":553,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7ae47f88194b73d9c04ce0b84320b8012f9bd63ebbd\",\"object\":\"response\",\"created_at\":1758783406,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7ae47f88194b73d9c04ce0b84320b8012f9bd63ebbd\",\"object\":\"response\",\"created_at\":1758783406,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_uxYgx7L7SEANkbb6LpJJ52Bs\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"7OKWXuOXdiGGQr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"3d4lTy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"oeZoC00Cha74l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"EXfWMS7WVyrMTU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"lVTktT1Ns9pU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"rFlpOGKevcWNT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"h5wB6FEiPBdjj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Y013wewmFaCmK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"RK7dvbo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"8j1SvAVRjTcbkP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Eb4E68fGQqTpe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Mqj7uPJWtFpST\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"9dCAj6VhDBTmmh3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ub8oCHgOrYJaiRU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"OUOF7gyzvZi5B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"O1qo4Z6N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"0VD5W9DUs9gsk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"O6h77ijAFrH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Kh1fiwYsjpUGy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"bW01b2SA1a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"QcrRylNKGrNB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"xJhBlL6Ts1hHoU1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"qJMccEoyl4S3Ay\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"6BbWZAdEAE41dT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"SoT6UE5N0EKpk1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"lediz9blFi5m09b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"XllQVbXQ1HVQ7p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"crAxKnp7eqAv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"l4INlFLc7GfDSGX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"B7GAYIlzhm0Lm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"gCtFagl7bqQCDU5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"zs3yTTmSwiolNE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"rUuLjZWJUQFgTV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"HVx9TgtkXG1xxS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"klocOspElIlUCJF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"QoL73SgTFECLT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"Ur8U7j7dbiLd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"654MCflS7ZcISxr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"IL8PIF77pM90U9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"kaI84kzcRJJSNH0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"PYAtOBfCamIYk6\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"call_id\":\"call_uxYgx7L7SEANkbb6LpJJ52Bs\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4e7ae47f88194b73d9c04ce0b84320b8012f9bd63ebbd\",\"object\":\"response\",\"created_at\":1758783406,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
              • Apples
              \\\",\\\"
              • Bananas
              \\\"]}]}\",\"call_id\":\"call_uxYgx7L7SEANkbb6LpJJ52Bs\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":553,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json index 2c4a66c9a1..af7b6242f5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_515fc265090a97b5957d74b469c33b46.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              \\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Y75q4dMbqo0i0F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5Szn5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"gF1RVlRvQjdBQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"EAV3WrpNCsmWQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"RgQt6wogD5uk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"K2LhoQWgAwXBQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"zDteKxoYkq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"XDBiHyHQgB6mm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"YraY4SG7MTl9n9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SSNuJWMe2mtjj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FvwEkS0UdGoao\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"NfP5f90sx2Y8ZOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"bpDpUuE1upDu6qv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"yMy5PeBXXIAJK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"2pZzydrgkFK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5sxXEpR92t6Us\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"CkoFD0pZqiStxN4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aSGko9BQgEJKhjS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"Xzgxue4i4jlj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"3IOigYcegCb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"v8xzV9fyDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"0zwJ9sjRox\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"1gDUqnVzprAPpDT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jUHwctr3bZBmEQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"aG8kljt4onqfK8\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdcfc5f88194b8e1fd4b7755f090050ed27eb2c0a183\",\"object\":\"response\",\"created_at\":1758707151,\"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_68d3bdd0b1648194b93f28426097551a050ed27eb2c0a183\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"call_id\":\"call_YwoCVcFjKU7LUJKzSHp2O1xw\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":523,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":551},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b120988195a3564e6287b82df70b4e59e9535dcdce\",\"object\":\"response\",\"created_at\":1758783409,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b120988195a3564e6287b82df70b4e59e9535dcdce\",\"object\":\"response\",\"created_at\":1758783409,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_b1wtebmTEkTsa9YT1pnoWvLB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xGvIJS1FtddzQ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"o3Szqk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"knOtJdD2DV8BT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"utq28MZLfxYFhn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"7HeeZZLhNge6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"cHYpAhqaiObys\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"JSbBNn9hSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TqHozEhG0MiZ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"yWZ6TNksEQVzXe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HZucIMr6B1MNJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"p9uGx4iubxXb4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"eBUNJ82WGpfip9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"SbdZZI6xQzuJmqg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"RPe6ITSCzyL59\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"34TFSQwlQb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"MDg6cyFVh3szL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"RaGsFxlMHjLDMI8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"wwtY8D1EwQyGI7y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"BrKAcxTmRJrE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Zbz7CZLvUam\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"3B8kD7Bini\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"3CKc7lQkxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"cypofRQlEkZcvmk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"cyKjv5fAXBx0YG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IW8CHEYMPVquGV\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"call_id\":\"call_b1wtebmTEkTsa9YT1pnoWvLB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7b120988195a3564e6287b82df70b4e59e9535dcdce\",\"object\":\"response\",\"created_at\":1758783409,\"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_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              You look great today!

              \\\"}]}\",\"call_id\":\"call_b1wtebmTEkTsa9YT1pnoWvLB\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":523,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":551},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_17d834e2d1cae83d1da0998fdfb46c08.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_17d834e2d1cae83d1da0998fdfb46c08.json index 17c296f535..00efe4ec42 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_8b3ffb6dae7c315b3e82f9946a90dab4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_17d834e2d1cae83d1da0998fdfb46c08.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the last sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"7SpY2yZjylJHOT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"DjaUTg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"i1ncoujuPVO4G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"7Y1qAD6j9euB0y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"iV3dEpTQMjYO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hdrl7PKD6SoI1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"o1tsmFrN7dMBO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GxUe1QQyIjdOU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"EaT1k6h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"vKSXxLbCsiaWCv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"e7xHufyThkOUn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tPRwPLzpYKn77\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"cjWdk4jeFyxzhmx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"s1CUZtNEmEF3ujv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"d7tG9ZQWBWBcd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"qhjIbdL1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yza4aJT8t9np2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"fgoLLV99agr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"h6mMx4n7OwyTB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"av4ywti1I6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"LyehxKE4JLmk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"i5W2pPCGURVxvH4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"3VgHwKUxOZ5yZ8a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"LU4LKtUWn30f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Nr1Kojc1Xd7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"E2uLgvce5F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"t1czlG1T5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"qIS5yvxY87LcI5X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"eFIn7dTsJmGiP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"4RwM4gItyZhp0mU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"P8Dpe8pYPmy1ar\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdcb9af88193b3682543240e300f0b79ff520bd62a01\",\"object\":\"response\",\"created_at\":1758707147,\"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_68d3bdcc339c8193a5525c026ca3b3380b79ff520bd62a01\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_isrKRBNQEM5Z9Z6Xc3iANc2h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7ad0ee8819593003956761fcc420ca87f1c76341e67\",\"object\":\"response\",\"created_at\":1758783405,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7ad0ee8819593003956761fcc420ca87f1c76341e67\",\"object\":\"response\",\"created_at\":1758783405,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_xrPAXW9fVFaQeZXslKeNL95e\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XVHZb6UbVs4m8E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"ilVKKm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ak5JfJg7F9fB7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"SKolH0Y9uW435L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Msd2NHk3gCjJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"b8nAKU418fvSt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"aJadv8EOwH1eB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"aBXel17FAwXjx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"0K2qE3c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"Xaag2ei0natUTQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"liSQMweOdM6Yh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"VSNODKibkIx1r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ugzKZrrcZ8r54Om\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"4LoWOFExwesELd7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Ld4EGvXUk9QUt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"tLDBvSl0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Bo8mE0KGp6AJe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"83n2aPfDYZR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"C1MQFYQTAGmcr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"K3OXWusVQh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"Hm65DSIqkPE1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"3ZH1jMZA0s5BYGC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"wc9LVAyk8BG8zbX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"tjlcrlhnKtIR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"MsQQMEGJvcM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"vvTVbh8SrK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"DFmPwd7C9p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Exz0ulAjBdO3I9a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"7GBpAQnmUHAWV0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"YHEZqQWNdC95VSz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"x1q5f6FskEkLs4\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_xrPAXW9fVFaQeZXslKeNL95e\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7ad0ee8819593003956761fcc420ca87f1c76341e67\",\"object\":\"response\",\"created_at\":1758783405,\"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_68d4e7ad99308195b20c3236c088fbc50ca87f1c76341e67\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_xrPAXW9fVFaQeZXslKeNL95e\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_fded5061f67d6e01b6704bcaf1181daa.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_fded5061f67d6e01b6704bcaf1181daa.json index 187adf0e7a..a615a0ce74 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_c2b667d1ebaad426133a8964247d929a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (start)_1_fded5061f67d6e01b6704bcaf1181daa.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              How are you?

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' before the first sentence\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"rSW9zuiSsjANxZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"skL2jM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"SFZTsPwNoRc0W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"CTRZpTzUEyN4sD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"SgAo15TINziF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"01uigxgxcPz7P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"1lqvZEr5c6z8q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"KI2DlCAtMB3J2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"wqYO72G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"jwkxER1WOUu6uG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pdCB21VxBupy8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"TevthtYZUb7N1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"76uenp9jxgMry6P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LCNXFGL1pzy9uZK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VNSHubyaZhkiL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"ui3fBnEK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"oukXfJFoba7Ke\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"Ab8OYNncpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"i1hnNhhnVQZvi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"ToRXgK5IlC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"ShQeYuNXouT4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"hvbuvBAK3O3m6XN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"avSnYD4tsEKXn1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"ITBtBAtqah0G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"m4iHe1aYWc6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"0XYBExKWuO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"YYeQi3jqJB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"W3IFiU0qD26fLfv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"x7pchBLwXEuWeE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"5CqbGVuFMc7nOGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"r01rNL1yOI8wNq\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdca2d2081969007abdc81be3ba90bf57404025cafc3\",\"object\":\"response\",\"created_at\":1758707146,\"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_68d3bdcac72c8196adf2c4f17bf11f820bf57404025cafc3\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_9Z1zG6hpfVUYX9ntER9lWkLo\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e837e958819592d702c6e5b7c6d7030ea987e3653172\",\"object\":\"response\",\"created_at\":1758783544,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e837e958819592d702c6e5b7c6d7030ea987e3653172\",\"object\":\"response\",\"created_at\":1758783544,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_aVQCJvApzBnwUPNgrlTN1omj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XEOn14ig5kROtX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Nq4PqK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"QQlCigoQzGh1y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ycj3nGMPNrKnTa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"SPVHh9mzEH1u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zHKf4HK2ShoPp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"PUZk9Vxq1xXnK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"XpcwWUFxgACfa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"rYk9oRI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"bJra7b2vIs8NEy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PAomYFOQn8143\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"7KtkqDlYEKQ1d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"3vwjUInPwz5RhHi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"3g2QSDlspDA8uZZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4q6ftWyFWDMAW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"VvwMLTNf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"R2N9jfvStioj0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"89syDIpdus\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"LfXN2w4mIv2b3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"zDyo4ABkA1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"LgVEgHGhBvg8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"jCadpUNkzS7tgSr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"oGEQKK8kmkFXS3G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"Kzzn4eTv2Dga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"CYwBkJFaSPN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"1O4ZNJNBFz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"6jii7wVPaB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"kDPTbO2FewmHIJ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"wXOfmgcJ8glTIM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"iZZ2hafSle4oP91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"vLzWc53wqJpcXU\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_aVQCJvApzBnwUPNgrlTN1omj\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e837e958819592d702c6e5b7c6d7030ea987e3653172\",\"object\":\"response\",\"created_at\":1758783544,\"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_68d4e8388590819590a4bb2844542474030ea987e3653172\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_aVQCJvApzBnwUPNgrlTN1omj\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":551,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":585},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_c859fc3e363e6b44c406982880adeaf8.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_c859fc3e363e6b44c406982880adeaf8.json index a51b3e0f94..22c59c9ded 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_b8f8172e1f05d89ec1582ce86fd1f81c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_c859fc3e363e6b44c406982880adeaf8.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01MPN6mesfc8N91BT7gikaug\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_0163FFTSPxh7ao14Rhay7QdH\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"perat\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", wereld!\\\"},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"add\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"referenceId\"}}\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\":\",\\\"positi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"on\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"afte\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"r\\\",\\\"blocks\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[\\\"

              You loo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t today!\"} }\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\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":135} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015RkRYm4PAXbHuTtc4ppdwK\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01A2RqnXSgKh4Yav7pubXmht\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref1$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", wereld!\\\"},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"add\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"referenceId\"}}\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\":\"$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"position\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"after\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"blocks\\\":[\"} }\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\":\"look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"toda\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y!

              \\\"]}\"} }\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\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":135} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_a721c27bc0944c3390dbcf6cbc4aa30d.json b/packages/xl-ai/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_a721c27bc0944c3390dbcf6cbc4aa30d.json new file mode 100644 index 0000000000..7a5603dcc9 --- /dev/null +++ b/packages/xl-ai/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_a721c27bc0944c3390dbcf6cbc4aa30d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014aRD33fEG5zyyb7GpRq3tr\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01CwNAAmwE9Grq9oqUrknSjB\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dd\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"referenc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eI\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\",\\\"pos\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ition\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"before\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"locks\\\":[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              You look \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"great today\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"]},{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\":\\\"

              H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo

              \\\"}]}\"}}\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\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":132} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_ae989a416fa1cb51342f1da4c5bbe105.json b/packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json deleted file mode 100644 index 92f09f21a6..0000000000 --- a/packages/xl-ai/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_ae989a416fa1cb51342f1da4c5bbe105.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015LkpLmqH4rifHr49UKGQm7\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_017KhpzMZ8Y41ZQHU3r8V6jU\",\"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\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"add\\\",\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eferenceI\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"posit\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"before\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"blocks\\\":[\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              You look\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great toda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]},\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"2$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              Hallo<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/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\":1078,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":132} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_fc80a600d06d9b0a834b3a8dc062d077.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_fc80a600d06d9b0a834b3a8dc062d077.json index 5e5a2ac472..4a5ba40a22 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_378d0283669b8b42c263e6465eed1050.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_fc80a600d06d9b0a834b3a8dc062d077.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhk3eeeka9303hrj1bnmmj\"}}\n\ndata: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8d66d348a\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c4921ee7-8415-499d-8e0f-bc3b0e07a773\",\"object\":\"chat.completion.chunk\",\"created\":1758774005,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhk3eeeka9303hrj1bnmmj\",\"usage\":{\"queue_time\":0.088422372,\"prompt_tokens\":959,\"prompt_time\":0.078587168,\"completion_tokens\":60,\"completion_time\":0.133440472,\"total_tokens\":1019,\"total_time\":0.21202764}},\"usage\":{\"queue_time\":0.088422372,\"prompt_tokens\":959,\"prompt_time\":0.078587168,\"completion_tokens\":60,\"completion_time\":0.133440472,\"total_tokens\":1019,\"total_time\":0.21202764}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-e09622d3-5278-4c18-851c-0acabe9c2bf8\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztkaaje0bssv4fvk6fbs25\"}}\n\ndata: {\"id\":\"chatcmpl-e09622d3-5278-4c18-851c-0acabe9c2bf8\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"fz0shvae6\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, wereld!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"blocks\\\":[\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\"],\\\"position\\\":\\\"after\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"type\\\":\\\"add\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e09622d3-5278-4c18-851c-0acabe9c2bf8\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztkaaje0bssv4fvk6fbs25\",\"usage\":{\"queue_time\":0.085076153,\"prompt_tokens\":959,\"prompt_time\":0.07923487,\"completion_tokens\":60,\"completion_time\":0.136116418,\"total_tokens\":1019,\"total_time\":0.215351288}},\"usage\":{\"queue_time\":0.085076153,\"prompt_tokens\":959,\"prompt_time\":0.07923487,\"completion_tokens\":60,\"completion_time\":0.136116418,\"total_tokens\":1019,\"total_time\":0.215351288}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ea6525e3996561d49f3baaa53e5f4367.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ea6525e3996561d49f3baaa53e5f4367.json index 2172f8501f..79e9bf79db 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_cb62f56bbbb5b00e359df80a7d87023a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_ea6525e3996561d49f3baaa53e5f4367.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw2p6fxsb8vkf8m343fpg\"}}\n\ndata: {\"id\":\"chatcmpl-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z4dzc1qb2\",\"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-9665cebd-08c7-429a-abc1-839ec5320420\",\"object\":\"chat.completion.chunk\",\"created\":1758707190,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw2p6fxsb8vkf8m343fpg\",\"usage\":{\"queue_time\":0.086536756,\"prompt_tokens\":784,\"prompt_time\":0.064184677,\"completion_tokens\":70,\"completion_time\":0.162873336,\"total_tokens\":854,\"total_time\":0.227058013}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-7e1e61de-eb79-4dc9-829a-b2c19d13a0af\",\"object\":\"chat.completion.chunk\",\"created\":1758783450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztkante0ba6vd2atrsgr75\"}}\n\ndata: {\"id\":\"chatcmpl-7e1e61de-eb79-4dc9-829a-b2c19d13a0af\",\"object\":\"chat.completion.chunk\",\"created\":1758783450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"4zz71sppd\",\"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-7e1e61de-eb79-4dc9-829a-b2c19d13a0af\",\"object\":\"chat.completion.chunk\",\"created\":1758783450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztkante0ba6vd2atrsgr75\",\"usage\":{\"queue_time\":0.133257189,\"prompt_tokens\":784,\"prompt_time\":0.065948,\"completion_tokens\":58,\"completion_time\":0.135874592,\"total_tokens\":842,\"total_time\":0.201822592}},\"usage\":{\"queue_time\":0.133257189,\"prompt_tokens\":784,\"prompt_time\":0.065948,\"completion_tokens\":58,\"completion_time\":0.135874592,\"total_tokens\":842,\"total_time\":0.201822592}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_a6ed8e1b1d7287f11052e60d21aa3c61.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_a6ed8e1b1d7287f11052e60d21aa3c61.json index 8578971a57..e8c8e6ea7e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_d83ed705634e892e8905fadc0f4c5d0b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add and update paragraph_1_a6ed8e1b1d7287f11052e60d21aa3c61.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ihzi7YlLVDExtN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DNXWg1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"70iOqF3Nugsi6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iy6NmUEFqKST0R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"e9xahORMssW7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"C61oQz3wAoZD9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"OvvM5aT00a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"d5zrl9WVz9zT3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bZZ1Xr7yVBwukp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yUiEciDlRu6mS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"AggPjdTg4urnO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"97CVMFfHuQEqMKK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RdXlUDWvq2VLUs1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yI6LUdR2RTNur\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"zrMgYg4veYD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"S03nE1hI85UfQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rzR63quDoEXKEYu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"eDpm5ubuuJuLaHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yr43F5O0AxNek0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Hq8lS1ZJMgY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vy775kr8RpOZ2YE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"WflGX5a6m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"3htu0ITWrPwjzK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"w4CBYUbuWcVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"UYKQUEx4aN5j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pYyU68kauq6g8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"v1RWI6d2XL6Kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RaHjdRCK0HWRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"C6DVrou\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"MbcIK3DhifVkQc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pIK18pUn2E6Jz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Y99k9WJxeTzYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"shR0Ri4t989suJy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"GbvBbfoMhcAR9Ku\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RPH0jdfpKjbnr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"PGxm1egw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ex4ieTPFcVc4g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"7stxVvWHIH1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"2InVBgR20h2vr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"6ZA4Fdj86G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"4EQeYS2HPQxB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Nhf0JjYggxB7jtx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Nsm3MwXTqlVNQC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"xqxncdHhLLo6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"HGFKGW92JzD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"FOve6oEjTH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"K5k5olpFPJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"XfoxM136enH6yFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"wMLZS0LVohWwzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"1aGjsu6svw7Tz0Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"OX6ZgfyP1fTspH\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d3bdc762548196b1b11cae04e0205d0d004fd630c8b112\",\"object\":\"response\",\"created_at\":1758707143,\"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_68d3bdc7daa0819696dcdac7f3399c1a0d004fd630c8b112\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":746,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":802},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a887b08196956e49c1985137000d500e386204899d\",\"object\":\"response\",\"created_at\":1758783400,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a887b08196956e49c1985137000d500e386204899d\",\"object\":\"response\",\"created_at\":1758783400,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"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_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"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_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"1JN6xolQtoJhe2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"TLEOjn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ax4i0s7AxSJS0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qNeBqmZ8QgZl71\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"6016FlaRMo3O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"VcgyOf2saZfJ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"J3Y2JWYFxg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"tai9sqpNJuT7p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"F2wsBRcRvEiX6S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"I4aDvJ5TmFWpn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"a17PyVxIjnXM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"VRboxtL1vnFZUSj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"HrIIpoR03zDVk3T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YV7dYM9xhcViI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"uHBEKtcCaRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Na8fSb6Zf7e4m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uvbo5bblREo4vbY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"X36Xf6G1tKhieFn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"aCVOcEkULaLwB6s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"7uGiWiCFVot\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"GquOIECXnbwmdmQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\" wereld\",\"logprobs\":[],\"obfuscation\":\"JC3SYRqR4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\\\"\",\"logprobs\":[],\"obfuscation\":\"EC2MO0KtfzKMUi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"ZiekgJ0f5IZA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"YAu0WCjggU8W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"bd199c3CKinix\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"pWXBh1jNDH236\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UlvmoTOrZ6ibA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"lkH2WIh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"gvjPD9myDOGreT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"H5tLFUdSyYhrZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"wwWCWRCu2UQon\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"vXedPGRTISPj3VE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"qInO7FbKsiz1M3t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YALqGfQdBm1li\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"0YK7pXVR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9vPFsxzjFXtTl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"after\",\"logprobs\":[],\"obfuscation\":\"2JaVdqoKUiT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LGahM58Z1Ltdm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"KZwS7kTOek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"b8YqkGZf6zA1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"IdxJzIILkHVMJlD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3fDzDRHBQlNaIgx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"kb0fQSbU9Ocj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"IW0euUCWXnf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"BIKLLom9iK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"LTteCKiwFf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"MYtidCgBexTvqhX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"02UWG5VuDvnsWf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"61AIuh5SeKkVV8A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"XuPwqBl7OAc3RM\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d4e7a887b08196956e49c1985137000d500e386204899d\",\"object\":\"response\",\"created_at\":1758783400,\"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_68d4e7a962148196b18f925138d2d5d40d500e386204899d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":746,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":802},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_3f688e4336780f36c03fe2e06fb38ae1.json b/packages/xl-ai/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_3f688e4336780f36c03fe2e06fb38ae1.json new file mode 100644 index 0000000000..df90b7fdcf --- /dev/null +++ b/packages/xl-ai/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_3f688e4336780f36c03fe2e06fb38ae1.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.openai.com/v1/responses", + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7aae43c81969506cc85aa31852e06932a6952fba75d\",\"object\":\"response\",\"created_at\":1758783402,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7aae43c81969506cc85aa31852e06932a6952fba75d\",\"object\":\"response\",\"created_at\":1758783402,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"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_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"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_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"M0cwk4bFoiLBPV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"2jnvwJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Mh2AkN8ho0Cm8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"711IHRWkncjUTU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"EzWcT5889qZS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"iWqsvSCJ9ryjm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"qLt57P2taW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"kqpLrV9I1Si9d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"w1eQn9HFOwwgsD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KcmtWNofw0qEt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ZKdK4BhRalM3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Y7eiUoheSqtJcm1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"fQ9IIAes1wqsdcg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"WevoTct2ojvSE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"4taJ8VpL3gr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"lolZjDmwMIFRy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"mECg2SnkNpMGErS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"RTsR71eOcAqGVZu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"JIc3k3tBxiJfhwG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"IeoP6RsVmM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"h1TMcNu74ZqlsQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"TTXX9VWc6Gip\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"3rb2XwvDDmVo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FxwPGVWsylHtW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"jYIYtzt5ZNgNq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cACuU0SZPV3g9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"rQHXFdA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"4F4hVw1v8k93AH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RAbyRUHaGrOso\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"pA1592msFhdxI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"etpnw5JxBenOamU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"eYt5nUnsaIuHdFr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"W63ITpWbuZtyD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"Vd9lR7CL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"pwO5RvTbTUfq4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"mZoyWaGCU8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qNMSGbbFlWU74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"a2O4Ptylm3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"g7UEXd0b2UFi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"hlcrJa56luMf0Gg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"EfyoGdHamyqS4sY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"vovleMWpyqbo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"7WNJuGulPH2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"0xesdgEfuh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"gUgnD9bIFj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"PqZVRKXci5fhQHA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"vyNCepTwG4dul2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"}\",\"logprobs\":[],\"obfuscation\":\"6XbFGsOftPJUZrU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"KdCXuGlkURAftG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d4e7aae43c81969506cc85aa31852e06932a6952fba75d\",\"object\":\"response\",\"created_at\":1758783402,\"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_68d4e7ab6f748196ab059f4d165f9d8d06932a6952fba75d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_c6fb82e817b9dad69fb7d7369cac5784.json b/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json deleted file mode 100644 index a6a56b3c74..0000000000 --- a/packages/xl-ai/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_c6fb82e817b9dad69fb7d7369cac5784.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ahuf3ZuYE2eMJD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"oSLgCI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"OrKFUR1wDTqXF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vWto6JQE06JK9V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"2PeHxFovMpMm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zAVbzfi5cUtqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"add\",\"logprobs\":[],\"obfuscation\":\"rjNQkLOZqqUF3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"yEEK3GZezXz4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"reference\",\"logprobs\":[],\"obfuscation\":\"l8vXPn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"Id\",\"logprobs\":[],\"obfuscation\":\"4CBAVhc6AX1AKl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hqCHf1fLVLmWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"gyt8NBcz0DYSa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"NCQiHwoBDd6Mys1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"PNTyzw5Kb8bf5gC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SnWo5Gt8M7S7S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"position\",\"logprobs\":[],\"obfuscation\":\"UipSumDD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Hv8qUlWtr2I34\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"before\",\"logprobs\":[],\"obfuscation\":\"4Me5rgt5q1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"134VgBQ2mTuuw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"blocks\",\"logprobs\":[],\"obfuscation\":\"xUGuqTOWrd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\\\"\",\"logprobs\":[],\"obfuscation\":\"lC0tGxcui23d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kwKVf4Zbo6wnGXr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LoVt8MMVTfcACCJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"RgRmQkZwUgwV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"hd2VzM1rJDJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"MW3cfbb13E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"xz7jzf0h8l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DTMPhjrqCxQUmzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"]\",\"logprobs\":[],\"obfuscation\":\"NQwBChUOeODjyX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"1Sm9100rHO0U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0culxhyWxMtT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cNQegYDFfoE7A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"NXjNsknJzq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gjJbfkpXTJ9CR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"OuS7s5y1RsBkI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hPGFJN2mAq0qs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"HrCmnvvKY66ia\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Lx2XRHI3gszrigT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"wpXc7SfbA8lt80C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"YVPZMMATZ14c1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"X3DzDRHRi9s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mgKyTUKBCAn3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"quSM5KcrLeOCRjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"E8jgyMmiCJeNtcr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"32tFoNjJcC3X0bk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"0UOxqGsTEjX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"1MREcowmDkPFxyl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"CbY5w8OqLVtEGz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"of3i6qq426n4Xs\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bdc8d5048193afbbf61941012b070b90169f1975a415\",\"object\":\"response\",\"created_at\":1758707144,\"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_68d3bdc93b8c81938d3c79be0c0caf380b90169f1975a415\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":571,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":625},\"user\":null,\"metadata\":{}}}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2ac4e99d05838a4666b65cfe9ffceee9.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2ac4e99d05838a4666b65cfe9ffceee9.json index 3638351736..b794be6541 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_8924f215c9d7466b6192b5a44fe35208.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_2ac4e99d05838a4666b65cfe9ffceee9.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"WrZX7ozwiRZzqi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"KJqeIq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"66NWai2diKBTt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ZxYfjck2QvVxtk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"yheL6itRm3BM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7zEZtjcFutYMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Yw1yKSjNMk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"uOjXCxhx6ep3i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6GPjPQOlOO4Yn3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yxslLlK2OBATJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"MLJg8XwLqThe1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"K1ZiiQxkzOhdWzq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ChJ0qbUvDR46acc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PAoSSEtV1pMqf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Ioqu1Zu5QvN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ar1W0CVavHTuT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"ILAVvnWRDIi9VkJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iBDElS0Y5Wc9CXc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"HDRQK88w6PQO4Dx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"pjWvzthwfoG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"RveaAE8cm6rv4di\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" wereld\",\"obfuscation\":\"GKfcCjpAZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"!\\\"\",\"obfuscation\":\"Ugc5LW1c4rsUoB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"Q4K1qPOX9h5z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tCNvtQDn9ysF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VvS7iLyFDeGrc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"yoMhyRqWea8aa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"apgM66NGgJT50\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"osaPSK3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"BwTz4ROeNI6Qxk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"swUxlrEP2kZgr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"IQH3bvmcVAoAl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"3eoMtnCJ1RAKzUO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"wtPKIGyfzQKW5AG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"L3rpwK9Ygy1DZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"9wSaBvsm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dC1nmsvAfxlsh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"qk5jTi8mdqg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hkWwAfVvGr64C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"8t1sws17Jb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"iRBCXlOEZHDj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"a4DiedCOD0Oy0yd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1PWCFaWw6szQevv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"dXswvjnsb7iY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"9GXdDah8sG6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"PIB4B5g29S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"zVchUD0YMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"72fMSXvl66mqcEz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"bIRgHYfcv72BYI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"pCd0NNVB9A4oPDY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"3RvitBaBuuuVlF\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bdea63748195a0c023cad0acb119057ef5212145912b\",\"object\":\"response\",\"created_at\":1758707178,\"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_68d3bdeae8888195a230dc0405d8f1eb057ef5212145912b\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_z5fnq3R3Q3gZpqRnoHY53eCW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":683,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":739},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e8d9a91481958122d20ef793503c0aa9397f946a9c4f\",\"object\":\"response\",\"created_at\":1758783705,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e8d9a91481958122d20ef793503c0aa9397f946a9c4f\",\"object\":\"response\",\"created_at\":1758783705,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_lgWwCpIXsSQMa5D3hjYKBjuI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"HNooR21BkDNYXo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"sFf4SB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"dqGdo7ivBJrs6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DRjFIErO93uo9Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"takYz9JJq2OS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"F2AFSc1ieBPrq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"zXz8YMhAOO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"LXtG1n6K6CQP2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"86IxHsYGtQeSls\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3nkSNtzfenifD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"DbmBexrwXq6d0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"FJ0I0A6gjQKCoo1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"H1BO3PFbke81UzT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8WvM3JZt0m45t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"RSoiVvhXCzb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"bqldqzWeMAqHs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"i4cop93O2GUH8kx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"CN1A3z56Eff36aY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"uuLY7C1X0Zfo35G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"C40iAg0FZER\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"GnMnyToCCI9JOTi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\" wereld\",\"obfuscation\":\"gtnXX6u7y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"!\\\"\",\"obfuscation\":\"EgF8lHtVQ3oMJU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"IlgFq1fbx9ee\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"29m0b36DB4cT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"FypHX3gaaydsE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"x9rV6zEFWJbQa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Kb1L08kBIPH3x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"7zUTjVa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"EE0lXHpsUd060n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yEWJfrxoEIZfR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"aQ8JkhAWg8XmL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"8gsp8ODRIRZkkJY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"dTWxEGlKzN9vMHJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ARP9MgWlz9LAm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"4rxEBJ47\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CcMJXjTWpnUbB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"after\",\"obfuscation\":\"eW3gYVGR24k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"AlFXwYb1NakFQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"SgXuUiYZbQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"WTGKz0tQwnUT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"a1K4PEjvF8P2q84\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"uiPog18ta4Ed0YK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"Az97z2SYIKhe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"ozqaYNVeFr5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"K7Xtz3xo2o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"aT6kfQYiWW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"tT1j8gWYMzdqi5q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"wgFNhSgh3J5Fa1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"}\",\"obfuscation\":\"QfVXkMliG1V0uoN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"CJhkjA9oNG45QT\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_lgWwCpIXsSQMa5D3hjYKBjuI\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d4e8d9a91481958122d20ef793503c0aa9397f946a9c4f\",\"object\":\"response\",\"created_at\":1758783705,\"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_68d4e8da81f4819582cb32557b57a8f10aa9397f946a9c4f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, wereld!

              \\\"},{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref1$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]}]}\",\"call_id\":\"call_lgWwCpIXsSQMa5D3hjYKBjuI\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":683,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":739},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_09dc8802102a3872a1bea73e45c076e7.json b/packages/xl-ai/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_dafc9c956b17f814f2e5daf2effc4612.json similarity index 61% rename from packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json rename to packages/xl-ai/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_dafc9c956b17f814f2e5daf2effc4612.json index cd584917de..548cc86938 100644 --- a/packages/xl-ai/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_09dc8802102a3872a1bea73e45c076e7.json +++ b/packages/xl-ai/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_dafc9c956b17f814f2e5daf2effc4612.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' at the beginning 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}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Y5p6lrOBMlfdIu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"MGgQ2c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ahQ4PWyb7MIvQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9QE5naOgvFX35j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"T32upPinDQfC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"snjomF3fvOJpp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"fYvLgFkjmSClQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Q3xaUYSBlEew7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"9QaWX2t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"6jUiTDwq5bO1Rf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1kC5TvDvlUPgI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"jFfvtZVKCbOxl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ihWBUSBvOS9fTnU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"dbXu18Fnt0oCO4L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"W6D0qEAOjtdek\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"8MKMOvBK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dIYpj0Xw8uuAq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"ZVyZ6FPlQP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Nx2dpmP5etTbg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"udm3fLzsOz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"79lXxXglvTOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"tO7sGy4bOrtSs52\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"y1Hm8g8zHuJAg9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"GgnY1irBhoD2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Vzo6PxpnppW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"XHTNsvfzth\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"BrQyXo05dH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6zIHreaO9IhkNdi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"RhqHBNzt44DBWy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"BPbcPMRaDg4W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"3mpwzQXtVwbH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"QGmr6WAs6jZEO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LQtHj0RTnd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ea24feVmpxR6H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"kSVRTmnKes8auO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GnOd51OFzBKNR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"jbEwwFguXTYTA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"gyjrx1lMIGSt3C1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"cNHoRhqUbgq0BIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"bOt7BpLYpgDM2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"RVMvWf2zZwk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Qu1ojwjDnTVoT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"93JhW3si4QMHT4d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"w4jXzuZkpKoHMO4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"xlYgUoKwMzx5UP2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"xYgR3woZAHX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"mfr4HWe01Ilinnu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"WOOquZFaWxLs2d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OZHDW929gPCB4D\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":57,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":58,\"response\":{\"id\":\"resp_68d3bdec382081968a288f68b075763d0a6e697287e95ac4\",\"object\":\"response\",\"created_at\":1758707180,\"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_68d3bdeccfac8196b402f3590bb9a5640a6e697287e95ac4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_OLuH8c1Rl7wnv6Emdld5m8L4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":508,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":562},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e8ebc7208197bf22689757382a730fd9d0fa77e24453\",\"object\":\"response\",\"created_at\":1758783723,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e8ebc7208197bf22689757382a730fd9d0fa77e24453\",\"object\":\"response\",\"created_at\":1758783723,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_rhQeGE3QJlPBDbHeR69nmsru\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XgdfABq7zFmJAm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"qOnL9E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"QdFaSZb6Gi2m6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JgKQMMXTGWgcAy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"LmaiqhpJfB6g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HfCRi3pSvSPwr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"add\",\"obfuscation\":\"oKagt54adPwFW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"M14AyzRHwpViU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"reference\",\"obfuscation\":\"0VBjBUy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"Id\",\"obfuscation\":\"roGyiz7PmEbSLT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jtXztla8Qqw6w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"JRH5knSuhDT5T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"hpHtmtBGA2Hbw5S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pvYqJf93ML9SPu5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"7uh3IKWL3yV5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"position\",\"obfuscation\":\"zBSXGVL2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"6FZoqw6qEIfOv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"before\",\"obfuscation\":\"qkIDh0mg0O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"moS6wKQorf3tQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"blocks\",\"obfuscation\":\"8mrPUPdOsn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":[\\\"\",\"obfuscation\":\"G7cQL0CNnNxs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"K5qnfiJKoGmlSYE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"6BCX8ITTaAQZu9z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"YtPXUYGmMgje\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"2XUL9ftLfCz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"AE1ur4gI1V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"XvrmwAlz9Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"hMknIAf3RLXebxb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\"]\",\"obfuscation\":\"KlwOWlsySpbj3I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"s4qJnvlYe12e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"dkt9ABRPbUAf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4lKlC7suMtV5i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"EhwAtCwWQ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"deTNRS3T8hcWb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"kdE9e6C6UJrt5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LMJ7pkE4v0WDe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"86ytK61llbfij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"FMcmi7ThY8Ga8Ud\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"y6PwE70XvQntxw6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"H7eZNNpMNIJJy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"lJ8gW0gBHwe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zk0T9eZN8QsBt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Fh6Io6hW8z1HOCH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"SnxLtP3Ve9zzJoI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"eCapKmcDGJfKRb1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"XungihbFoSy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"VUO5nE6zZvwberl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"LlmbKQ4PkXf2V1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"UQtMufCNihJ5f5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":56,\"item_id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":57,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_rhQeGE3QJlPBDbHeR69nmsru\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":58,\"response\":{\"id\":\"resp_68d4e8ebc7208197bf22689757382a730fd9d0fa77e24453\",\"object\":\"response\",\"created_at\":1758783723,\"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_68d4e8ec476c819796c327199c03c8a40fd9d0fa77e24453\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"

              You look great today!

              \\\"]},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_rhQeGE3QJlPBDbHeR69nmsru\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":508,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":54,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":562},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_24119724ddeddbe1d724375ad7546eef.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_24119724ddeddbe1d724375ad7546eef.json index 6ad8f67955..312d7d2bf8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_6a0dfd684aecfb69ca21f75edcd902ab.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_24119724ddeddbe1d724375ad7546eef.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0115gJcitQP6XWTotUEZY62p\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01UEy6Akwn3vJJukwn1tqKqx\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"delete\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":56} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019HtdB5YEF84ffc3DNh82wo\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Cf7DziTPodeFvNnwS4x9Lf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"del\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ete\\\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\"} }\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\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":67} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_fd0a1c180a2d6c7165823af96ca7a444.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_fd0a1c180a2d6c7165823af96ca7a444.json index b9a9152fc0..9cdc16cd7b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_7b22f1ffbbb14c43846e389319cf5f52.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_fd0a1c180a2d6c7165823af96ca7a444.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw1zpfxqvembrm82rks9z\"}}\n\ndata: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"h300af4gy\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ee3b4bd1-976e-4bb5-8ec3-f8d359de050b\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw1zpfxqvembrm82rks9z\",\"usage\":{\"queue_time\":0.086932652,\"prompt_tokens\":935,\"prompt_time\":0.077367815,\"completion_tokens\":20,\"completion_time\":0.04542206,\"total_tokens\":955,\"total_time\":0.122789875}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-b228cb63-e47c-402d-8883-bc768ade32c0\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk9xney6apvkw3r1exvpm\"}}\n\ndata: {\"id\":\"chatcmpl-b228cb63-e47c-402d-8883-bc768ade32c0\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"9adj263hh\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"delete\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b228cb63-e47c-402d-8883-bc768ade32c0\",\"object\":\"chat.completion.chunk\",\"created\":1758783449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk9xney6apvkw3r1exvpm\",\"usage\":{\"queue_time\":0.133096314,\"prompt_tokens\":935,\"prompt_time\":0.077927542,\"completion_tokens\":20,\"completion_time\":0.055029021,\"total_tokens\":955,\"total_time\":0.132956563}},\"usage\":{\"queue_time\":0.133096314,\"prompt_tokens\":935,\"prompt_time\":0.077927542,\"completion_tokens\":20,\"completion_time\":0.055029021,\"total_tokens\":955,\"total_time\":0.132956563}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_5c60f0de80e4a010dcf6e7b2f534b1d7.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_5c60f0de80e4a010dcf6e7b2f534b1d7.json index aed8da5460..944080f43e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_229a12c5bb3aad2c166d03b0409d2958.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/delete first block_1_5c60f0de80e4a010dcf6e7b2f534b1d7.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tZakErfWbqfwVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"fskY6F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3tMGX8NZolRds\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"marGj22auwzron\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"2NcLHitnr7un\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"l45YqYKm0UjJ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"TBmY4fyNmU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nDb5bbnh2xWEq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4CH24OmgC2JVwE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eYO2EXprlVi7y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tPiCNjVQZ6Lbu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ZIT7O91XO0v1Dj3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"QR0nwBHskrUeJD2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"IU0WpMo5tlNwSh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"M9M0YnMagXv951\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68d3bdc6054c8194a2391730a9709e50046f77927e50e2d9\",\"object\":\"response\",\"created_at\":1758707142,\"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_68d3bdc6e5f48194a9c9cf7e37fb06d7046f77927e50e2d9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":738},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a670a48195b24ff74d5acf59bb0dc524613ddaf8d1\",\"object\":\"response\",\"created_at\":1758783398,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a670a48195b24ff74d5acf59bb0dc524613ddaf8d1\",\"object\":\"response\",\"created_at\":1758783398,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"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_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"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_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"blNgUlrHX3QsmY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"KWUVXf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"WO93ll8QFvwyU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"032CLzUW4zrTdv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"fPOkTKuRBY7N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"y4xguOmNrkw8z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"delete\",\"logprobs\":[],\"obfuscation\":\"CUZkIJvRU6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"BAH5h6pbZl3j8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"NLPYQnKL12tjdT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BZuAGx0drC0Rp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yUGNJKPg6YJSA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"YzmVn6zc6QVGPK8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"K6Kvl0Sjc5rtTNI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"V3taS9TPjSQVdY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"VzxywBJfGZ9sGF\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":21,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":22,\"response\":{\"id\":\"resp_68d4e7a670a48195b24ff74d5acf59bb0dc524613ddaf8d1\",\"object\":\"response\",\"created_at\":1758783398,\"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_68d4e7a747a88195abc6541d2e4df7c90dc524613ddaf8d1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":738},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_9ee58319810833bcc30596aa06091958.json similarity index 78% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_9ee58319810833bcc30596aa06091958.json index 6704460a2e..2e94241fa2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_4ae5c2a0958c2e4d1d10b79972ddbd89.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_9ee58319810833bcc30596aa06091958.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"0EyqSdbLZNXEmM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"y2j7qe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"FbApPbBkjAaa5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"ZZvodaU9xYcV7C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"ZCZyda4PMgWN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"0MIGRibWh1Eqp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"delete\",\"obfuscation\":\"3Ez9jk3ND2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VjXVVzTa2ArYl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"iV6xw5bXIcoMrb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iZBOquk1OMDGp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"U8PAGCdKKymh4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"j0NvxMHiB2OKyQf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"9LHLWDzLf3wcEdh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"dPg86gIrp5lLoW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"l2FzCRYQfRn9ti\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":20,\"response\":{\"id\":\"resp_68d3bde9020c819391c83709cb4996fc0b73c13871aa5908\",\"object\":\"response\",\"created_at\":1758707177,\"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_68d3bde988a88193a351b692739af13a0b73c13871aa5908\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_fZyRiFHdXVRGiTnDxeADvYIp\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":675},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7caffc0819089920b11d0730016009aaf5e4703f39f\",\"object\":\"response\",\"created_at\":1758783435,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7caffc0819089920b11d0730016009aaf5e4703f39f\",\"object\":\"response\",\"created_at\":1758783435,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_hFZE0cKaKFIbeEDzIZ6271mG\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"h74OqbzA6AZfZW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"htm5ry\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"Ua2QpjpZM4wLd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"kTtkCR1JrMOM6b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"cStwxFwA5kSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GCRPF38wY9NGz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"delete\",\"obfuscation\":\"BuQrUhq6pr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"fP3U121et1VSG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"hg4coRXAD5GFam\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1RQnwIutVorpv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"G2eks7k3x72rD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"n3JQ5akYHu0tD8Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"x7ZF5M7yrVYvepD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"0cBxkTlGWZ7k8F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"HUweSbwYFCyHft\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":19,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_hFZE0cKaKFIbeEDzIZ6271mG\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":20,\"response\":{\"id\":\"resp_68d4e7caffc0819089920b11d0730016009aaf5e4703f39f\",\"object\":\"response\",\"created_at\":1758783435,\"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_68d4e7cb811c81908f0f74d0032fe786009aaf5e4703f39f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"ref1$\\\"}]}\",\"call_id\":\"call_hFZE0cKaKFIbeEDzIZ6271mG\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":16,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":675},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json index f0aaa36470..2546bc9356 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_77f51f99b9f3e4293594aa197dee7ff7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01T65bJ9rjoycDs5aXaK5t3q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_0167NZa6b4QCU1aHTG8eJd2K\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

              C\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"olored te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt\\\"},{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Aligned t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ext

              \"} }\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\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":121} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01HvBq8VF91gLM814mLDBhpV\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_014M3pzxp3AJTFWfNtiXPuYu\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

              Co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lored\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" tex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t

              \\\"\"} }\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\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"blo\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

              A\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lign\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ed text\\\"}]}\"} }\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\":1144,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":121} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_68d51d1950b2878e08616f9effbee616.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_68d51d1950b2878e08616f9effbee616.json index ebb16874b3..fc5684885a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_0f53bf27715200b28572c62747c24484.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_68d51d1950b2878e08616f9effbee616.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TaoZy6LuG3nWuSfKQKtADC\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1263,\"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_018n3Y72hjArm4qKcDjrYpqf\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"t\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef3$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"

              Hi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld! Bo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"the text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". L\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ink.\"} }\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\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":87} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Lx4NeH1hMDsDVHqdWMAHfa\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011mf7p6EoCtaAFoDxdMDv4W\",\"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\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref3$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\":\\\"

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hi, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"worl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d! Bold \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"the tex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t. Li\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nk\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\".

              \\\"}]}\"} }\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\":1263,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":87} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_1acc3cfa3a758ee4118f48b99e56f7b5.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_1acc3cfa3a758ee4118f48b99e56f7b5.json index 3e92bba2e8..9a5acd85b5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_7616ac20399dcfe20716ebb9fb26f4a6.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_1acc3cfa3a758ee4118f48b99e56f7b5.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01GceHsF6X7aSzXJ5XRsVpCn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VoopGQC3Ahc7vVZXhxi5TE\",\"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\":\"{\\\"operation\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref3\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", world! Bol\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt. \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Link.\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":88} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01QJtEc94rRvaC6F8bRX9kvJ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016KLSLDeWLinm4igYEAbibT\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f3$\\\",\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

              Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Bold text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". Link\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\".

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":88} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9158921bdd72e8f26eed1d4a3ccff6a4.json similarity index 56% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9158921bdd72e8f26eed1d4a3ccff6a4.json index d768ba62b0..7d0138fa72 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9fe94fb59d53d77f41dfccc5c6bcbf03.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify nested content_1_9158921bdd72e8f26eed1d4a3ccff6a4.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Xo5KnxnxVE4SW2et2aYRWm\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01QoDHhiUupreXKMBifxMF61\",\"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\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"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\":\":\\\"\"}}\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\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

              APPLES\\\"}]}\"} }\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\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01F2Hv2WjXNJ253X363854sb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HTMzooLKfJyw7BaNhceMWr\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"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\":\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>APPLES\"} }\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\":1099,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":83} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_a2946c73d9c3eeca81e4b4b08213a8a2.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_a2946c73d9c3eeca81e4b4b08213a8a2.json index 686bf15278..830cf3449f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_27fdad5a71c2b13b91130184d66a69aa.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/modify parent content_1_a2946c73d9c3eeca81e4b4b08213a8a2.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01H4xVSMuvqqVCVKieTPkxVe\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TnXnnHELUD2WLiX1rF2ktQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>I NEED TO \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"BUY:

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014L8gC6UAq8bp7QppPB3y2N\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Lg2YNghf1zmp6JnSuLhS9C\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

              I NE\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ED TO BUY:<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_91c94c8501e2f1d5d25c8e9c360dd3d1.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_91c94c8501e2f1d5d25c8e9c360dd3d1.json index 497dac6400..96105480fe 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7d062c80ac3907dba56f52908361d3c1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_91c94c8501e2f1d5d25c8e9c360dd3d1.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01XubVKZvQ3R3B14pvkysDeZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":8,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01SMViYnhWUG75efC5NZ5LQ2\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

              Hello\"} }\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\":\"@J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"an\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":104} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01RHWdfe3GttBYFD8uymp3hb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01EtHJqkA1WcbHgsnKBQqn9S\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"per\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\\\"Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@Jane Do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":108} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_adde6c9d6144449d4c436ed39a9afcb1.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_adde6c9d6144449d4c436ed39a9afcb1.json index 29cd295f67..7b6c6fe833 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_3a6b29b1670cf1ce1acc1c5a4aec9237.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_adde6c9d6144449d4c436ed39a9afcb1.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Hs6a6XbM9dYs4iAUDx1Dd2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011bo2ddhyeoB3Qy8biiiLnF\",\"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\":\"{\\\"operation\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"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>H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo, We\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lt!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K89m33oXhseDaoihmZZhks\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VbfEL5BFHto2moN6AhvgVX\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hallo, We\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lt!

              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json deleted file mode 100644 index 8fb45a14f6..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_1990cfafdbe6915cc301ba24ba6477c3.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01CZqe2XcRP2MNTs6roeMsyE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Mr2ynnUwUWoPmUtt9ueb2Z\",\"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\":\"{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ohn Doe! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" doing? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"T\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"his \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blue!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":147} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_4d2b9b00dc36b2bb12aae561adde829e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_4d2b9b00dc36b2bb12aae561adde829e.json new file mode 100644 index 0000000000..e5579c4e72 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_4d2b9b00dc36b2bb12aae561adde829e.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01DBgNaUXJ7tf1JNN2UW4S7q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01WyvDfvjy9ktfdr49g5c5vC\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              Hel\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, @John\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you d\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oing\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"? This te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt is blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span>

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":159} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_06ade1c91064a7b257315d7cfb3dae1c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_06ade1c91064a7b257315d7cfb3dae1c.json new file mode 100644 index 0000000000..407ae41c80 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_06ade1c91064a7b257315d7cfb3dae1c.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01VWWDSMaVw5PSXGyGgPVaNT\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Cko3mbKoa29sywhK5CW6PB\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"i\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"Hello! H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ow are \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"you doing? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Thi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blu\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":136} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json deleted file mode 100644 index 6710d2f87e..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_d3744e6f58b758ff270777a78212936f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_018wNnFHJ8hJFD28tYnYL2es\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TRJScQ9jfvqNrv5s5TgLoa\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref2$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! How are \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"u do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ing? <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"span\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" sty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"color: rgb(\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"11, 110\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", 153\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\");\\\\\\\" data\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"-style-typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e=\\\\\\\"te\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xtCo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lor\\\\\\\" d\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ata-value\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"=\\\\\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ue\\\\\\\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"data-editab\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\\\"\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":138} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_24881d7683d6ecbd852f58f6580259f4.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_24881d7683d6ecbd852f58f6580259f4.json index f556a21003..3237953e59 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_de47b8292e8d513efd1668566ad729cb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_24881d7683d6ecbd852f58f6580259f4.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01A3HP3Rpdncrh9TRnpSUDZk\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01C71VFSqtWWSc9EDSmvyYmZ\",\"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\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tio\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              Hello\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ed content<\"} }\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\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019WbBWd2h9YZpiX4Rrm4GUp\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01DgxzxsKRTwNzqccDGNLBAj\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"

              Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" updated\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_1c9a4f955e0248798e87ab2412de660d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_1c9a4f955e0248798e87ab2412de660d.json new file mode 100644 index 0000000000..67f4604f4b --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_1c9a4f955e0248798e87ab2412de660d.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015pJyps6S5YiRLVqSCZnoRA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LnuGKKLbDv3pepj4Aed8nQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"i\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ane Do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" you\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" doing\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"? <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"spa\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yle=\\\\\\\"color\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": rgb(11, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"11\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"0, 153);\\\\\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\" data-sty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le-t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype=\\\\\\\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xtColor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\\\\\" data\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"-value=\\\\\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ue\\\\\\\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ta-editab\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\\\"\\\\\\\">Th\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"is text is b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lue\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":165} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json deleted file mode 100644 index 2e8a211afa..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_7557f4e0b1168c9cfa85cc2949d3483e.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_0128hRNbpfm3T3hRKZuWc9oZ\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01E5kmmUENV4kcQM3twtRXQa\",\"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\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"Hello, <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"span data-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"inline-con\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tent-type=\\\\\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"mentio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n\\\\\\\" data-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"user=\\\\\\\"Jan\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e Doe\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@Ja\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ne Doe! Ho\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"w a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"doing? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"This text is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" blue!

              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":165} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json deleted file mode 100644 index 2e090e2b13..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_57abff3f1cf681ccc8006b74bf065746.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TnbZKBXSacGLso4f19br1A\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01YAiWAwScSWF4CrrPQtjqEC\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\"\"} }\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\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"Hallo,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" @Jo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"hn Doe\"} }\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\":\" Wie geh\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t es \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"dir? D\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ies\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"er\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Text ist\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" blau!

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":171} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_9e3a8c2b7c0c40aa89c4b52ccf040007.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_9e3a8c2b7c0c40aa89c4b52ccf040007.json new file mode 100644 index 0000000000..58623e1b39 --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_9e3a8c2b7c0c40aa89c4b52ccf040007.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01N6gguFbmrpB3zPNjTV8Qze\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TGKKHKnfNjJzgv5tkY2z8C\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              Hallo, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@J\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oh\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n D\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong>Wie \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"geht e\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s dir?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/s\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"trong> Die\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ser Text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"st blau\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"}]}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":171} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_d4c19bfff5993efff243e799e4055cc9.json similarity index 57% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_d4c19bfff5993efff243e799e4055cc9.json index 0b7a94bad1..abe7d54ccc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_b3f7fe3d4ea02a94ae3e41b71b289fa2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_d4c19bfff5993efff243e799e4055cc9.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01LmRCUnBVwfhYryzTm9q19j\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01PRnmEWxVqGwW5DPGV3KMBh\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"at\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": [{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

              <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rong>H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ello, wo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rld!

              \\\"\"} }\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\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01627EKhkLMKM1YfPmyjQizq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":14,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LdYkLMWitySqsvr8FNPdWQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

              <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong>He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e31071ae9ad80a23786ec0afc5106c32.json similarity index 61% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e31071ae9ad80a23786ec0afc5106c32.json index d4f3e8d2d4..3cbe3ab07d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_7ff67bb25bb9fd7f6a332ea948e9b322.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e31071ae9ad80a23786ec0afc5106c32.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01RV5tbqWDWmxQhU3vmp6J1g\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01T2Ariyp6YHfWQwMPMjWmEu\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014QMhbYAsD6Mam73kEccqyw\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016xYmjNXJLrvVDbtQDhDXqg\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"

              He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, world!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"<\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_efc8d37a125c48a5d0af15ecaf8e4b20.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_efc8d37a125c48a5d0af15ecaf8e4b20.json index e0afcf4772..2a5339ab7e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_3e1e8046704f4c1272001e1f1002f592.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_efc8d37a125c48a5d0af15ecaf8e4b20.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01LC532PudHrVLg1kXzn9VfH\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_018VPNup8jRbsc9xRssAzj7i\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"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\\\":\\\"ref2$\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hallo

              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_016ydVFMkR31aTbroxEAtZGc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01RPXHoaopVHdtZWFheCZuyb\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"Hallo<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json new file mode 100644 index 0000000000..79a24cab4e --- /dev/null +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json @@ -0,0 +1,15 @@ +{ + "request": { + "method": "POST", + "url": "https://api.anthropic.com/v1/messages", + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"block\\\":\\\"

              Bananas

              \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [], + "cookies": [] + }, + "response": { + "status": 200, + "statusText": "", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014K6CNAX5tbFU1Gw6uWChfS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01RzTizFiGwvLVxC3GFVvTS3\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"
              • A\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pples
              \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"},{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef3$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
                \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
              • Banana\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s<\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
              \\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":129} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "headers": [] + } +} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json deleted file mode 100644 index aa8148ea8c..0000000000 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_8f32e048b79fef7ba196203c0790ac1f.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "request": { - "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"block\\\":\\\"

              Bananas

              \\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], - "cookies": [] - }, - "response": { - "status": 200, - "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01JdzLd8DD8eXm6KUSS4Cfkj\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01V9f5wY3LQvz5QFSg3tmZoY\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ration\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"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\":\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"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\":\"
                Apples\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"},{\\\"type\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"3$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"
              • B\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ananas<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":127} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", - "headers": [] - } -} \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_4f6fdb800f1928aed2629f707b95b0da.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_4f6fdb800f1928aed2629f707b95b0da.json index 5a56275b05..c9936efa47 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_2281ea1801f2a209eee53f1a861410c2.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_4f6fdb800f1928aed2629f707b95b0da.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01L29NbnAst8tgrdgtkCKrjA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":14,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VtXvGar6qqJJtGq2Xuc2iJ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"type\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"blo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ck\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              Wha\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t's up,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" world!

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":91} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01L99utQ9mBCxR3ppqt7YCnN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016tU1TWK2qZCVTcMUeQEdpq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"

              What\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"'s up, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"world!\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":93} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_b25dd6e47055e54d58f1fd1f18feb14d.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_b25dd6e47055e54d58f1fd1f18feb14d.json index 037f0e8204..a2e80e76b9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_9e2953494168bd54125bdfba22ba90f4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_b25dd6e47055e54d58f1fd1f18feb14d.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `

              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01HYUKhkjBwpLFd6wUKDkSB3\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01565ChPuuVi822pmgchs6Fx\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":89} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019kwHkF3Kx6zNyKfrFMrCPE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VD5oiJ6pNFixdAfJbqREu7\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p styl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e=\\\\\\\"text-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"align: righ\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t;\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":91} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_de3f09510d3c3eee14653fe5799dbae7.json similarity index 62% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_de3f09510d3c3eee14653fe5799dbae7.json index 14cab7d625..092fbeb7d6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_d28bae3e96103e3163113d1ff73a4f54.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_de3f09510d3c3eee14653fe5799dbae7.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Hw4Zgyk7jLimsfwGfZ3JFq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HQ9zWquBvzjAUxAj1MJESW\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\\\"What's up, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"world!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/h1>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01NjK3YpTUqen9fN6aq95pWX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01B4gv765bCEAvV2r6Kkn64q\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"atio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\":\\\"

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"What's up, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_d805af33ab12e1bf8f2cb1a055a91fbd.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_d805af33ab12e1bf8f2cb1a055a91fbd.json index 09e9a76499..1b912ca85a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_4e773d841fb9bd378ccd5ef3a22d0ec3.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_d805af33ab12e1bf8f2cb1a055a91fbd.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages", + "url": "https://api.anthropic.com/v1/messages", "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"type\":\"text\",\"text\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_013AjuPpfcAq6iLevQ1KbdxL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011WfWZ37XjFxEVtKdFmvcHC\",\"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\":\"{\\\"opera\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tio\"} }\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\":\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ll\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"o, wor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ld!

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":83} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Dct1y6cHK3zr6sAm4TYqES\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01U8jVttrTVfGGFKWvBbrCD2\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ra\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"

              \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, world\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!

              \\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":83} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json similarity index 74% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json index 8df3655b2d..2c3ab6187d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2428cf5bf38fe19cbc3bc7ff315bce4f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhbya3ee9tv82at7dh8bx3\"}}\n\ndata: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"dyjhtex04\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6f016cea-a844-4632-8a19-36bc2f040148\",\"object\":\"chat.completion.chunk\",\"created\":1758773770,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhbya3ee9tv82at7dh8bx3\",\"usage\":{\"queue_time\":0.086486201,\"prompt_tokens\":853,\"prompt_time\":0.072832573,\"completion_tokens\":53,\"completion_time\":0.110220643,\"total_tokens\":906,\"total_time\":0.183053216}},\"usage\":{\"queue_time\":0.086486201,\"prompt_tokens\":853,\"prompt_time\":0.072832573,\"completion_tokens\":53,\"completion_time\":0.110220643,\"total_tokens\":906,\"total_time\":0.183053216}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk9hpey6934px74m454ay\"}}\n\ndata: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pznsbf1sf\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk9hpey6934px74m454ay\",\"usage\":{\"queue_time\":0.143383351,\"prompt_tokens\":853,\"prompt_time\":0.083652147,\"completion_tokens\":53,\"completion_time\":0.102347837,\"total_tokens\":906,\"total_time\":0.185999984}},\"usage\":{\"queue_time\":0.143383351,\"prompt_tokens\":853,\"prompt_time\":0.083652147,\"completion_tokens\":53,\"completion_time\":0.102347837,\"total_tokens\":906,\"total_time\":0.185999984}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_1138449389739970ddab00e2ca2b4bca.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_1138449389739970ddab00e2ca2b4bca.json index 0ef411b287..72f13cf027 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_cf6f0ea25e679a2c084fc62111763c1f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_1138449389739970ddab00e2ca2b4bca.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw0fyebcr1pp9jyc2h90a\"}}\n\ndata: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"x1nk8fysq\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-11753106-97a4-4089-9652-c569330f0606\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw0fyebcr1pp9jyc2h90a\",\"usage\":{\"queue_time\":0.144097222,\"prompt_tokens\":954,\"prompt_time\":0.07877144,\"completion_tokens\":38,\"completion_time\":0.074128877,\"total_tokens\":992,\"total_time\":0.152900317}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk7rxe098nrb9ap54bj3t\"}}\n\ndata: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"q9jmph8gx\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk7rxe098nrb9ap54bj3t\",\"usage\":{\"queue_time\":0.167779801,\"prompt_tokens\":954,\"prompt_time\":0.077852963,\"completion_tokens\":42,\"completion_time\":0.082497339,\"total_tokens\":996,\"total_time\":0.160350302}},\"usage\":{\"queue_time\":0.167779801,\"prompt_tokens\":954,\"prompt_time\":0.077852963,\"completion_tokens\":42,\"completion_time\":0.082497339,\"total_tokens\":996,\"total_time\":0.160350302}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_2f40ee8072a0c34e771a2bd001d04b3a.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_2f40ee8072a0c34e771a2bd001d04b3a.json index 4dbd3f431f..9bccc0baf6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_27ea0e2007440ced1773d35273014e75.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_2f40ee8072a0c34e771a2bd001d04b3a.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw00afxna0kgky7b3826b\"}}\n\ndata: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qq2jyc3hz\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1947adee-9d96-49cc-82ee-7838ba1db48c\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw00afxna0kgky7b3826b\",\"usage\":{\"queue_time\":0.166709976,\"prompt_tokens\":948,\"prompt_time\":0.076982977,\"completion_tokens\":36,\"completion_time\":0.101701348,\"total_tokens\":984,\"total_time\":0.178684325}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk7cae08rnk2nqttpvx27\"}}\n\ndata: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"d8b6jv74w\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk7cae08rnk2nqttpvx27\",\"usage\":{\"queue_time\":0.144757613,\"prompt_tokens\":948,\"prompt_time\":0.077655455,\"completion_tokens\":36,\"completion_time\":0.100339898,\"total_tokens\":984,\"total_time\":0.177995353}},\"usage\":{\"queue_time\":0.144757613,\"prompt_tokens\":948,\"prompt_time\":0.077655455,\"completion_tokens\":36,\"completion_time\":0.100339898,\"total_tokens\":984,\"total_time\":0.177995353}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json index ae8623622e..4be2c93f81 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_ba9a41e978e1758a1fb428c11d631624.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw15zfxqbm26k2mzz4pxt\"}}\n\ndata: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"waxhp7yjk\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-666e6fbf-a9c5-4a2e-b9e4-18ffb21d13f4\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw15zfxqbm26k2mzz4pxt\",\"usage\":{\"queue_time\":0.166731611,\"prompt_tokens\":813,\"prompt_time\":0.066054562,\"completion_tokens\":31,\"completion_time\":0.071206716,\"total_tokens\":844,\"total_time\":0.137261278}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk8wte0av0596h5byvmyp\"}}\n\ndata: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ff7ddq74b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk8wte0av0596h5byvmyp\",\"usage\":{\"queue_time\":0.145155619,\"prompt_tokens\":813,\"prompt_time\":0.068726179,\"completion_tokens\":31,\"completion_time\":0.067908684,\"total_tokens\":844,\"total_time\":0.136634863}},\"usage\":{\"queue_time\":0.145155619,\"prompt_tokens\":813,\"prompt_time\":0.068726179,\"completion_tokens\":31,\"completion_time\":0.067908684,\"total_tokens\":844,\"total_time\":0.136634863}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json index 7d48f121bb..0cc62d93c8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_1e07c0d2dedf068b2c1e9dd7dcb10f6b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw1jtebcskd1vcvqys2g9\"}}\n\ndata: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"8fm5kzz3b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-653e3c57-3aac-4161-b633-3dea1b0ac452\",\"object\":\"chat.completion.chunk\",\"created\":1758707189,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw1jtebcskd1vcvqys2g9\",\"usage\":{\"queue_time\":0.143857134,\"prompt_tokens\":815,\"prompt_time\":0.067731051,\"completion_tokens\":32,\"completion_time\":0.08735868,\"total_tokens\":847,\"total_time\":0.155089731}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk97je0ats42dhpqxpy95\"}}\n\ndata: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1ydxzxq8x\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk97je0ats42dhpqxpy95\",\"usage\":{\"queue_time\":0.133331912,\"prompt_tokens\":815,\"prompt_time\":0.068012475,\"completion_tokens\":32,\"completion_time\":0.073286743,\"total_tokens\":847,\"total_time\":0.141299218}},\"usage\":{\"queue_time\":0.133331912,\"prompt_tokens\":815,\"prompt_time\":0.068012475,\"completion_tokens\":32,\"completion_time\":0.073286743,\"total_tokens\":847,\"total_time\":0.141299218}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_89cf6c28cb2ec992330f7c1bdc342068.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_89cf6c28cb2ec992330f7c1bdc342068.json index 6234d3986c..75fd29b377 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_aa9cc3df7357c7df8c4aab4db25ef364.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_89cf6c28cb2ec992330f7c1bdc342068.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvz66fxjv95e1gkexrrp0\"}}\n\ndata: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0tdt7aw85\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-14d7673d-fcc8-484b-8ef9-da534b8ca146\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvz66fxjv95e1gkexrrp0\",\"usage\":{\"queue_time\":0.16673624,\"prompt_tokens\":946,\"prompt_time\":0.076665564,\"completion_tokens\":51,\"completion_time\":0.091593556,\"total_tokens\":997,\"total_time\":0.16825912}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk6fze06andww0kjfkhy4\"}}\n\ndata: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jtmhkcm8c\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk6fze06andww0kjfkhy4\",\"usage\":{\"queue_time\":0.169828534,\"prompt_tokens\":946,\"prompt_time\":0.077438792,\"completion_tokens\":51,\"completion_time\":0.110801372,\"total_tokens\":997,\"total_time\":0.188240164}},\"usage\":{\"queue_time\":0.169828534,\"prompt_tokens\":946,\"prompt_time\":0.077438792,\"completion_tokens\":51,\"completion_time\":0.110801372,\"total_tokens\":997,\"total_time\":0.188240164}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b300195a352d5bddf97a0136eeb314e6.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b300195a352d5bddf97a0136eeb314e6.json index fc74fa800d..7227624fd3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_786c4803ef13f91d0ee9d9d5ef7efd53.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b300195a352d5bddf97a0136eeb314e6.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvtz0fx7a1aa8ej6qfwhb\"}}\n\ndata: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"p8z7r7qat\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-26a51ee3-cb5a-4221-8f85-d15e6007fcd3\",\"object\":\"chat.completion.chunk\",\"created\":1758707182,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvtz0fx7a1aa8ej6qfwhb\",\"usage\":{\"queue_time\":0.086775633,\"prompt_tokens\":937,\"prompt_time\":0.076552274,\"completion_tokens\":36,\"completion_time\":0.074209049,\"total_tokens\":973,\"total_time\":0.150761323}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk1mvfzz9wa75773temf3\"}}\n\ndata: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"w4nesfnw7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk1mvfzz9wa75773temf3\",\"usage\":{\"queue_time\":0.250621162,\"prompt_tokens\":937,\"prompt_time\":0.075776116,\"completion_tokens\":36,\"completion_time\":0.078861683,\"total_tokens\":973,\"total_time\":0.154637799}},\"usage\":{\"queue_time\":0.250621162,\"prompt_tokens\":937,\"prompt_time\":0.075776116,\"completion_tokens\":36,\"completion_time\":0.078861683,\"total_tokens\":973,\"total_time\":0.154637799}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_008db1a44c8ee4e4d98c2e62c05f1906.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_008db1a44c8ee4e4d98c2e62c05f1906.json index 715e677155..19feca5c5a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_1a4818ddc5602370cb091f26c8975028.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_008db1a44c8ee4e4d98c2e62c05f1906.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhh12behdrzhgct4gzcb34\"}}\n\ndata: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xz27agpnx\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-309bbb18-c6ff-4029-9157-9a00a5fe0a27\",\"object\":\"chat.completion.chunk\",\"created\":1758773937,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhh12behdrzhgct4gzcb34\",\"usage\":{\"queue_time\":0.135983471,\"prompt_tokens\":939,\"prompt_time\":0.076725115,\"completion_tokens\":97,\"completion_time\":0.164452156,\"total_tokens\":1036,\"total_time\":0.241177271}},\"usage\":{\"queue_time\":0.135983471,\"prompt_tokens\":939,\"prompt_time\":0.076725115,\"completion_tokens\":97,\"completion_time\":0.164452156,\"total_tokens\":1036,\"total_time\":0.241177271}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk4xhe08a90de0a5q7c0p\"}}\n\ndata: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"7gkfmcyzf\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk4xhe08a90de0a5q7c0p\",\"usage\":{\"queue_time\":0.094632691,\"prompt_tokens\":939,\"prompt_time\":0.098137394,\"completion_tokens\":97,\"completion_time\":0.166019247,\"total_tokens\":1036,\"total_time\":0.264156641}},\"usage\":{\"queue_time\":0.094632691,\"prompt_tokens\":939,\"prompt_time\":0.098137394,\"completion_tokens\":97,\"completion_time\":0.166019247,\"total_tokens\":1036,\"total_time\":0.264156641}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_9a1800c42b72be41038a25622ff00709.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_9a1800c42b72be41038a25622ff00709.json index 7fa70920e0..6ecfa94975 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b01041740d43371bbdbb83b9df9b82d8.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_9a1800c42b72be41038a25622ff00709.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvxz5eb69pb2rdfc19py4\"}}\n\ndata: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"y95vgr1y5\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable;\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-69afb0e2-468b-4f73-b216-84be69c5ab57\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvxz5eb69pb2rdfc19py4\",\"usage\":{\"queue_time\":0.208335082,\"prompt_tokens\":955,\"prompt_time\":0.077725755,\"completion_tokens\":79,\"completion_time\":0.146208048,\"total_tokens\":1034,\"total_time\":0.223933803}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk5ane08ba9d151jbrmg3\"}}\n\ndata: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"02x22hctr\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk5ane08ba9d151jbrmg3\",\"usage\":{\"queue_time\":0.141083415,\"prompt_tokens\":955,\"prompt_time\":0.109837475,\"completion_tokens\":80,\"completion_time\":0.15087099,\"total_tokens\":1035,\"total_time\":0.260708465}},\"usage\":{\"queue_time\":0.141083415,\"prompt_tokens\":955,\"prompt_time\":0.109837475,\"completion_tokens\":80,\"completion_time\":0.15087099,\"total_tokens\":1035,\"total_time\":0.260708465}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_0463e82390d623aec168d4e483a8e7c1.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_0463e82390d623aec168d4e483a8e7c1.json index 5a455758ef..66a55138ee 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_78610509e4014344defb72c2362d3410.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_0463e82390d623aec168d4e483a8e7c1.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvwbxeb4rwkpx70cbp1ys\"}}\n\ndata: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"vwxkv1vf0\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b843e4d0-7186-4a24-8ee1-76ef531d2ffb\",\"object\":\"chat.completion.chunk\",\"created\":1758707184,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvwbxeb4rwkpx70cbp1ys\",\"usage\":{\"queue_time\":0.086807459,\"prompt_tokens\":945,\"prompt_time\":0.07606187,\"completion_tokens\":32,\"completion_time\":0.064029603,\"total_tokens\":977,\"total_time\":0.140091473}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk3y2e01963m228rp0156\"}}\n\ndata: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b69014kwr\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk3y2e01963m228rp0156\",\"usage\":{\"queue_time\":0.091541682,\"prompt_tokens\":945,\"prompt_time\":0.078752951,\"completion_tokens\":32,\"completion_time\":0.07319935,\"total_tokens\":977,\"total_time\":0.151952301}},\"usage\":{\"queue_time\":0.091541682,\"prompt_tokens\":945,\"prompt_time\":0.078752951,\"completion_tokens\":32,\"completion_time\":0.07319935,\"total_tokens\":977,\"total_time\":0.151952301}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_cf6b0ebb12aa86b848af40e9fa5aa4c6.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_cf6b0ebb12aa86b848af40e9fa5aa4c6.json index 32cffa4284..8d924a685a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_56fcf64add84f7ad27f74ca4b26befc1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_cf6b0ebb12aa86b848af40e9fa5aa4c6.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvzj9eba8h2205s84wa9n\"}}\n\ndata: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wr19gk2bj\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8a8904d1-50f3-4126-bbb9-b2d2d7989c53\",\"object\":\"chat.completion.chunk\",\"created\":1758707187,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_f089a29207\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvzj9eba8h2205s84wa9n\",\"usage\":{\"queue_time\":0.143051224,\"prompt_tokens\":937,\"prompt_time\":0.077586645,\"completion_tokens\":102,\"completion_time\":0.17471478,\"total_tokens\":1039,\"total_time\":0.252301425}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztphvfe3ya7tax976zxv1a\"}}\n\ndata: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"yspgvwnek\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztphvfe3ya7tax976zxv1a\",\"usage\":{\"queue_time\":0.13352253,\"prompt_tokens\":937,\"prompt_time\":0.080579121,\"completion_tokens\":106,\"completion_time\":0.184377315,\"total_tokens\":1043,\"total_time\":0.264956436}},\"usage\":{\"queue_time\":0.13352253,\"prompt_tokens\":937,\"prompt_time\":0.080579121,\"completion_tokens\":106,\"completion_time\":0.184377315,\"total_tokens\":1043,\"total_time\":0.264956436}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_2b8a7aa1c2a0945eb657e1784120dabc.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_2b8a7aa1c2a0945eb657e1784120dabc.json index c52133bc6d..d70c997e7d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_7923c4dc04dcbcf37a3b53e86136bcf0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_2b8a7aa1c2a0945eb657e1784120dabc.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvwnfeb4rsvbmt1prps0y\"}}\n\ndata: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"m9yzm6t3g\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-561992e9-eb5d-46e3-a161-1501735310cf\",\"object\":\"chat.completion.chunk\",\"created\":1758707185,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvwnfeb4rsvbmt1prps0y\",\"usage\":{\"queue_time\":0.428420367,\"prompt_tokens\":946,\"prompt_time\":0.081082891,\"completion_tokens\":105,\"completion_time\":0.200575041,\"total_tokens\":1051,\"total_time\":0.281657932}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zty9dfehcs27pxj6bthe7d\"}}\n\ndata: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pgnbjbgar\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zty9dfehcs27pxj6bthe7d\",\"usage\":{\"queue_time\":0.144850274,\"prompt_tokens\":946,\"prompt_time\":0.077445191,\"completion_tokens\":105,\"completion_time\":0.204622915,\"total_tokens\":1051,\"total_time\":0.282068106}},\"usage\":{\"queue_time\":0.144850274,\"prompt_tokens\":946,\"prompt_time\":0.077445191,\"completion_tokens\":105,\"completion_time\":0.204622915,\"total_tokens\":1051,\"total_time\":0.282068106}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_7f14399291525650d7f05c5015dd3b59.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_7f14399291525650d7f05c5015dd3b59.json index 3817c9be44..2a0fceb7b3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_29ac6f2077f9c4a913971e9de8992d64.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_7f14399291525650d7f05c5015dd3b59.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvysdeb983tgha9stmq1y\"}}\n\ndata: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jjdwhvd36\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7de25348-fcbe-4fe7-90f3-70ab4c1c3f9d\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvysdeb983tgha9stmq1y\",\"usage\":{\"queue_time\":0.084468027,\"prompt_tokens\":935,\"prompt_time\":0.077872485,\"completion_tokens\":35,\"completion_time\":0.096342441,\"total_tokens\":970,\"total_time\":0.174214926}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk66ce05a1eg9e4cd1342\"}}\n\ndata: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"v5ge2cf8c\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk66ce05a1eg9e4cd1342\",\"usage\":{\"queue_time\":0.087740881,\"prompt_tokens\":935,\"prompt_time\":0.077809774,\"completion_tokens\":35,\"completion_time\":0.094247314,\"total_tokens\":970,\"total_time\":0.172057088}},\"usage\":{\"queue_time\":0.087740881,\"prompt_tokens\":935,\"prompt_time\":0.077809774,\"completion_tokens\":35,\"completion_time\":0.094247314,\"total_tokens\":970,\"total_time\":0.172057088}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_710f89bc66a6352e1c21328e600f2536.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_710f89bc66a6352e1c21328e600f2536.json index 76dcda989b..1deeb5a169 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_493fb526ec9f5849dd3fed6d4354b6a6.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_710f89bc66a6352e1c21328e600f2536.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvyemfxgb1m7ryhjmr6q3\"}}\n\ndata: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"0wat0gmh4\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a9585cd4-37b6-485b-a517-62e464e240d9\",\"object\":\"chat.completion.chunk\",\"created\":1758707186,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvyemfxgb1m7ryhjmr6q3\",\"usage\":{\"queue_time\":0.143436393,\"prompt_tokens\":942,\"prompt_time\":0.076689219,\"completion_tokens\":36,\"completion_time\":0.072927659,\"total_tokens\":978,\"total_time\":0.149616878}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk5rxey4tzk8qn3s929eq\"}}\n\ndata: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qw3tk1n43\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk5rxey4tzk8qn3s929eq\",\"usage\":{\"queue_time\":0.203406796,\"prompt_tokens\":942,\"prompt_time\":0.077748982,\"completion_tokens\":36,\"completion_time\":0.088546668,\"total_tokens\":978,\"total_time\":0.16629565}},\"usage\":{\"queue_time\":0.203406796,\"prompt_tokens\":942,\"prompt_time\":0.077748982,\"completion_tokens\":36,\"completion_time\":0.088546668,\"total_tokens\":978,\"total_time\":0.16629565}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_d2ee0ac3b245b97f7a730d85a4575ac3.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_d2ee0ac3b245b97f7a730d85a4575ac3.json index 058548c8df..03aa16fe8a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_db456b037057f990036a9dbe4c7f0119.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_d2ee0ac3b245b97f7a730d85a4575ac3.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvv9beb3amje89x40971x\"}}\n\ndata: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"f78rx5sng\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-990331c7-504a-45e0-aaea-70cf4f30add8\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvv9beb3amje89x40971x\",\"usage\":{\"queue_time\":0.084479472,\"prompt_tokens\":767,\"prompt_time\":0.06452397,\"completion_tokens\":34,\"completion_time\":0.083579414,\"total_tokens\":801,\"total_time\":0.148103384}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk233fzztw9yhzpp1g1rp\"}}\n\ndata: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"43teqva05\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk233fzztw9yhzpp1g1rp\",\"usage\":{\"queue_time\":0.202438742,\"prompt_tokens\":767,\"prompt_time\":0.061756423,\"completion_tokens\":34,\"completion_time\":0.071081873,\"total_tokens\":801,\"total_time\":0.132838296}},\"usage\":{\"queue_time\":0.202438742,\"prompt_tokens\":767,\"prompt_time\":0.061756423,\"completion_tokens\":34,\"completion_time\":0.071081873,\"total_tokens\":801,\"total_time\":0.132838296}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json index fe8dde0566..1447528156 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_6aaa6ae6676b070495550b20a0e90b18.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhw0txebcrhvakz9d3ejdk\"}}\n\ndata: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"wk87fy1rt\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1b78d149-efcd-4d5b-a4bb-8eccc75da175\",\"object\":\"chat.completion.chunk\",\"created\":1758707188,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhw0txebcrhvakz9d3ejdk\",\"usage\":{\"queue_time\":0.084589358,\"prompt_tokens\":687,\"prompt_time\":0.056308459,\"completion_tokens\":60,\"completion_time\":0.114429398,\"total_tokens\":747,\"total_time\":0.170737857}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk84xe09sgh5p9m6kz2em\"}}\n\ndata: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"h8cg4zpwp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk84xe09sgh5p9m6kz2em\",\"usage\":{\"queue_time\":0.537078687,\"prompt_tokens\":687,\"prompt_time\":0.052994038,\"completion_tokens\":68,\"completion_time\":0.124627288,\"total_tokens\":755,\"total_time\":0.177621326}},\"usage\":{\"queue_time\":0.537078687,\"prompt_tokens\":687,\"prompt_time\":0.052994038,\"completion_tokens\":68,\"completion_time\":0.124627288,\"total_tokens\":755,\"total_time\":0.177621326}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_e22ef915ccf69ed6d2eb9f1a04b86c20.json similarity index 76% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_e22ef915ccf69ed6d2eb9f1a04b86c20.json index 9757cd48ce..d548f0561e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_f90a6f351669841e970de61ba1f65964.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_e22ef915ccf69ed6d2eb9f1a04b86c20.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhgd5gex0b78ffagwb2bqk\"}}\n\ndata: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"k767zwyv7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ffb97250-a956-4b14-8e59-08bba23cff55\",\"object\":\"chat.completion.chunk\",\"created\":1758773917,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhgd5gex0b78ffagwb2bqk\",\"usage\":{\"queue_time\":0.087851709,\"prompt_tokens\":949,\"prompt_time\":0.076126094,\"completion_tokens\":40,\"completion_time\":0.090098744,\"total_tokens\":989,\"total_time\":0.166224838}},\"usage\":{\"queue_time\":0.087851709,\"prompt_tokens\":949,\"prompt_time\":0.076126094,\"completion_tokens\":40,\"completion_time\":0.090098744,\"total_tokens\":989,\"total_time\":0.166224838}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk3mmey4aya79sfng8ha3\"}}\n\ndata: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ecnrb52mg\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk3mmey4aya79sfng8ha3\",\"usage\":{\"queue_time\":0.087015992,\"prompt_tokens\":949,\"prompt_time\":0.078642555,\"completion_tokens\":44,\"completion_time\":0.077594348,\"total_tokens\":993,\"total_time\":0.156236903}},\"usage\":{\"queue_time\":0.087015992,\"prompt_tokens\":949,\"prompt_time\":0.078642555,\"completion_tokens\":44,\"completion_time\":0.077594348,\"total_tokens\":993,\"total_time\":0.156236903}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6d4c550d09a7bfdb440308f277b85a11.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6d4c550d09a7bfdb440308f277b85a11.json index 943dd6bf7b..d7992d5388 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_4891c1a65bc4e4241a6f5f32e41bc8d4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6d4c550d09a7bfdb440308f277b85a11.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zhbxd4es19cj54f79gzbh4\"}}\n\ndata: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b65g7fkd0\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1e806b39-4109-4eb3-9d71-4c39fbe1f14b\",\"object\":\"chat.completion.chunk\",\"created\":1758773769,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zhbxd4es19cj54f79gzbh4\",\"usage\":{\"queue_time\":0.136485163,\"prompt_tokens\":937,\"prompt_time\":0.076527714,\"completion_tokens\":42,\"completion_time\":0.082351693,\"total_tokens\":979,\"total_time\":0.158879407}},\"usage\":{\"queue_time\":0.136485163,\"prompt_tokens\":937,\"prompt_time\":0.076527714,\"completion_tokens\":42,\"completion_time\":0.082351693,\"total_tokens\":979,\"total_time\":0.158879407}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk2x4e07r3enkvn246nd8\"}}\n\ndata: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"c800nyyst\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk2x4e07r3enkvn246nd8\",\"usage\":{\"queue_time\":0.143502652,\"prompt_tokens\":937,\"prompt_time\":0.077230823,\"completion_tokens\":38,\"completion_time\":0.091863369,\"total_tokens\":975,\"total_time\":0.169094192}},\"usage\":{\"queue_time\":0.143502652,\"prompt_tokens\":937,\"prompt_time\":0.077230823,\"completion_tokens\":38,\"completion_time\":0.091863369,\"total_tokens\":975,\"total_time\":0.169094192}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_2448cba67be91338d1977d4a980761a6.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_2448cba67be91338d1977d4a980761a6.json index 1d05d1c507..baa451a00f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_05e99794cdf9cc8f2a2ad5e43c0f43dc.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_2448cba67be91338d1977d4a980761a6.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvw03eb38m8cv9tnnds18\"}}\n\ndata: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"edpf98tj2\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-82f8af75-06a7-4dd3-9ef1-f2c8b6a721be\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvw03eb38m8cv9tnnds18\",\"usage\":{\"queue_time\":0.089876329,\"prompt_tokens\":949,\"prompt_time\":0.078248716,\"completion_tokens\":36,\"completion_time\":0.08635079,\"total_tokens\":985,\"total_time\":0.164599506}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk38ke009j9wnaeejb24r\"}}\n\ndata: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"bcwjg029p\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk38ke009j9wnaeejb24r\",\"usage\":{\"queue_time\":0.168121985,\"prompt_tokens\":949,\"prompt_time\":0.078238666,\"completion_tokens\":36,\"completion_time\":0.087214503,\"total_tokens\":985,\"total_time\":0.165453169}},\"usage\":{\"queue_time\":0.168121985,\"prompt_tokens\":949,\"prompt_time\":0.078238666,\"completion_tokens\":36,\"completion_time\":0.087214503,\"total_tokens\":985,\"total_time\":0.165453169}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_88fade9a250bf912d8d65f9db17e6de7.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_88fade9a250bf912d8d65f9db17e6de7.json index 84c38cdbbb..d2ed7c7142 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_67b84d717ff0d339705097fd3776d332.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_88fade9a250bf912d8d65f9db17e6de7.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions", + "url": "https://api.groq.com/openai/v1/chat/completions", "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "data: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5xhvvjxeb3bdvfznd9nqs9z\"}}\n\ndata: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qbmv8z23g\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a214decd-f762-4121-85fe-aa0205f1edc1\",\"object\":\"chat.completion.chunk\",\"created\":1758707183,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5xhvvjxeb3bdvfznd9nqs9z\",\"usage\":{\"queue_time\":0.143733727,\"prompt_tokens\":937,\"prompt_time\":0.07726139,\"completion_tokens\":33,\"completion_time\":0.091185592,\"total_tokens\":970,\"total_time\":0.168446982}}}\n\ndata: [DONE]\n\n", + "body": "data: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk2h9fzzvs2pcmwaftr36\"}}\n\ndata: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"07r9p88c7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk2h9fzzvs2pcmwaftr36\",\"usage\":{\"queue_time\":0.143721537,\"prompt_tokens\":937,\"prompt_time\":0.076420397,\"completion_tokens\":33,\"completion_time\":0.08854522,\"total_tokens\":970,\"total_time\":0.164965617}},\"usage\":{\"queue_time\":0.143721537,\"prompt_tokens\":937,\"prompt_time\":0.076420397,\"completion_tokens\":33,\"completion_time\":0.08854522,\"total_tokens\":970,\"total_time\":0.164965617}}\n\ndata: [DONE]\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json index 296ae9e766..8fbb0df2ab 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_e36e05c66a1610414db2b182e5838630.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5uLsBt8WOkxbw7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"0ZhCO9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"6z34bNaVLbsQk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"uuAF4wAlT9JjuY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Btq96bxr8W6D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3Pjgzk1Gu24U9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"0J3Uxok5Ec\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"PO1pnoWVzc2ja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"uuB8z8MLRcGiWY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"I5dkbfkYGE5b9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"LUcuk2j6r7zhD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KYfNe29NiIqmIuA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"kzxiBTblv9Xp8iV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iPlRakbLsWOpP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9KE3JQLaCTz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ITuEAGNCVBKXr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"uFLkof4Oh9y4jQr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"0SrTaKhIzerazZ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"EXIqMntHigjaJmx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Colored\",\"logprobs\":[],\"obfuscation\":\"6AgRvDmsf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"tVDyXDuNXUv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"lWBLDo0AdY9UVe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"wwOMhrljaTsg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"6Jo2qDSKXebH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GP5W9o215SzRn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"SiUmkftrrp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UNonMn6mSuSIu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"WqhewL2YuSGxHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9wUklSPPRGolC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kTQg2W7qLEYnq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ChKAoagb19ifyB0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3PngERGmC4RywQV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aSLt89EVgfS6G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"g7b2OWs3jAu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8duvzkAZb7Sdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kecHfMwHfnrpX0L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Bc05cgBYon3cEum\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"LdVvyGIFLMQD33E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Aligned\",\"logprobs\":[],\"obfuscation\":\"dCPpQPcb8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"TOtdGNfcIpJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"sBF1mbQZoN5gUAx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GWHEGqBADFe1V7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bp1HXxia7s4Ikb\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":52,\"item_id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4c20081688196acb2ced39ae2f2e002d789c2f9091f3a\",\"object\":\"response\",\"created_at\":1758773760,\"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_68d4c2013bf88196997ab447f8e6b80b02d789c2f9091f3a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":639,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6i1M6yN7vBfkDY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"q5H0Oz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"d5Ljk7zXZE7ZN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SBQGjcQoEaOByY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HtJY3PREWEqs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hqdJNSeLJOPAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CDayC8kcYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VxqhkmdwRiRjh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"yTB3a081bUn9IG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ztqcmmv5ahyBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"poYnZfINzZAiR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gfpIJ2Tp1onhNga\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"GIyCBanLVEPowYC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Gzl4tddDO2St\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"sZQjzE34J2F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dJpgAagjRYKE0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"jVinnhWuLjMniZK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"h72YEEzAJ0SetTW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"QMDUZiSErZpX7pW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"Colored\",\"logprobs\":[],\"obfuscation\":\"6GEOZxOPR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"T27S1mJZXMX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"LMoNQm27HYsmfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"gmk4UHl0rX3o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QoAGQ3FpZpmG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2qwOKdUNWsKOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"UL4TZPCw2p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SY9EzuDO0Gel5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"pDjowpvG40YyNe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x82Xe0rf6G8ML\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sJAeeIyj1y2Ks\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tLkpl6UlRXXkhVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pZTMVtYRypymPcm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XXDMIt2FEWr0A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Kc4mYTz95cH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5tE9P5PYKtfpv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1h3FlzzgH4r3eoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WAvXTEnifWodpx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"8JNynTYOTdWw4iU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"Aligned\",\"logprobs\":[],\"obfuscation\":\"IiuU3Ay0C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"SCFpvNOFn9G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"DJoLQg0EoQqfEWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ctbQqB92pQbmjg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3e8yBsv5VbW7ta\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":639,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json index 43145975bf..1906c78660 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_8924ab7942a31319ff0bed562dc978c7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ArGQGIf9DtGvGO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"bIqGFi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"WtTjLt3ctKvmw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vPZYS0tKgx6h3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"t8Crcf41yM2R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kn0mP2hQzWvK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"SiM2iufR8k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pRJxi171aXiAK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4XM4SFqAcosaMw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"L6vbyNmoEc4aS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WgiaqvyQtDBWW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"iO20vXZfzS5O5ZM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rB6iuZ2J8K30DZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Vw7vYFRgmYidF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"995idUyX8sq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"NwQ1otrpD7cva\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"RQhkaKDT7ncdZBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Ubwg5fplxp990yy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2QFva7WrGvEqbRV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"j79UzHsdccvuZa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"mn4InWuhgFRhcYN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"nxBsumkEca\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"LTAP5xtZKPmlbNj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"uqOpYZpVHQI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"8TPlPkVNg2oc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"PwQ1cJx1WG0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"9uvUqO80hdYoz1p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"TnjWdsSGM3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"kVs7sxE4bFvZgqO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1a9umI9Xx9jURI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RgUOdPIMNehB39\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d3bdc050208193b8e351f185fc131d07ab549c4a2b0bc1\",\"object\":\"response\",\"created_at\":1758707136,\"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_68d3bdc0c990819398655d2f660e09f107ab549c4a2b0bc1\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"kqfshPneAwKvKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8sfKvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"tooImfHKEOHWe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"T7ZAhb32nL9hj1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DF9vvfI5e7kx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ughf7CwqROxsA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"pYS1iTVZOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i8Lf3ucxBYphM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"eDLk5XoSaioOOs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YhTRXAGUdKhvy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Nc3XVXJ602K5R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"01PFTs1PZyk7him\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rm5UHNXTAKL58T4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jqIJtekFldk2o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"eJU2CUCdbrs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"J2iplNO4hlDQK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"py6a04fyL7eoHYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"4wFg8Op0MvlvnXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"PCBw3yFlXpvqhBv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"hiA9xYgs6KzilM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0crCko3q0KgMZ7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ppnfB2J9Hv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"MV8DC5rwtD6RPlF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"QqPFTeKw6Tl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"9eNcneQYPZVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"sNqtx4mJPgk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"YO5KJ8XwufgSeJ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"BW4oFOT0EeN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"RH4sHWD3Ik0vCOY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"vfIIRX3Pzqlu1W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"KyAMxBlIQuZml6\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.json index 5101a1cd1e..c88aaca20e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_bb22d361bb5e6f25a9ba5357553fd8f4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XPJab5zLSUIEeK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"m2IW4W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"KJFxUWAUzU7pJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Az8pSw205uGbXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HZhSe4J3GFri\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oNlDTPm4gQm1p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"2KRP41NAZS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"gZeTjF3UEJFjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"BhvsDkovXDdDk3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"GCO4EjzrHK5cg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"pLX78FYG8aRim\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"fSQWvSs5QHrmaYP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"nHpjf48NMO5EorH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"uBPIhr20viL90\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"m18mxGywiA0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3je9Q94gA6fJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"kgeIQkLcovzjxLs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"fWvUnrszKV5UUeG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"yEjut31BWR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"EKtVRxtilT4NZBc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"KVnyiycTvV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Ii4jQWEwmltgqVl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"c5WMeRkMEgp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"LQAAF83Wi7F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"VuJnNSI2M5WOvNX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"OTAT8a55Mbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"2YB1zDgs9qYjHcE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"p21cho4wscpfn5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"uGy658YnvnaVL1\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdbdedc881979d0aee68b76c08d20d078a26a19f09bf\",\"object\":\"response\",\"created_at\":1758707133,\"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_68d3bdbe64688197a41979c1364bd12a0d078a26a19f09bf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"R7o1iU4YOEHnPP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"g5fcYw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FGjPGrQUclSGq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tOnTgNNEYU1Q7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tBVdmWXE8gcJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Gysi9mbFBcuwP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"PcDxTqZnWl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UzToza8409Lmc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mQ9GDghDru2n73\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0dbs9emDWjsad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ujMiRKY2ksrrP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"bL7blvnuZSWSsS6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"2xeXs8ex09PWU8p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rJU5YM4WVeRWn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"icnCVSd8bkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TeoMKkPbNocRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"MKgceoRprmy2gnn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ql6yzfdoIE7qj46\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"juI3yozAUx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"zHCNhAyQiqWn8vj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"dUPVVovryX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"JklPFb4FuNBhGKN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"WtYvcahs9RF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"lZioBbRBErs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"x89bCez0r51Qesr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"rJTRrFupFai\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"m8vmeI0jsDcPPN8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"acJiE9DVkqOv1b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"N0zkvFL4jTvvGc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json index 453fc512ff..7910e55411 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_fce88de162f505469f329e0963496770.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TT8N2yVLtNTic1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"91Z8P3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"435HOS4EUQ5gi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BzdMaaX6sVIkGJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"pEHKihYhNXW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o6rIymz8J75Vo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ICvTupVbJV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"A9H5csFonLXf0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"dgrjvYsnANkpRj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gelkaohmmxfTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"WB3WsyqBFBxdS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Nv07Nd5rKbuWvJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ATgsENTkL37jKoD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hqQ57C4DDHHDN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"wnpkkdvHGWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o9FIQ7FgX5cip\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"rEUNHbqPADntwDK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tB5GiQeXCuuAVxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"pCH5yJlbiroILlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"7ADpLi6vW6x3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"LQKsPbDuDFJYA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"XqnKJbbLTyssiz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"s4zV1wd3ahOsNc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"BBFGSUUibXKLQW\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d3bdc27d4081978214f58373ee64990c2f6c405d131445\",\"object\":\"response\",\"created_at\":1758707138,\"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_68d3bdc306108197a7e5674c7e3ef5b00c2f6c405d131445\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"IkNZ5C3D1pL1m8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"c9WHsU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"abgAw0VhKFZW3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CQMnlMdzwnUSbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Xvu7dCRNx1Op\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YgHUzbeP4ArbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"GQ1mzRiU26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Bkh5i7CJk1tFc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"8wAwc34W1gJqCJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kFk1n38o7wulv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"cofeERc2K0Rfc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tmuM1xs03qMJRgn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mdiOndfEtHiNYBQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7XPJnh10Xg8BS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"5l1pDy1gLUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZkaAxHMzCtifD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6KDYAGJ3r5c18pD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"D170vThK17FqEDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Ei9UhFkUhzQyp5N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"eiW14kOCAJ9Bt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"Cb1OdO2nwV3fw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"MP6fflBX64sG6AK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"oRy8H8itOZ1IvD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bqMKeou6HSc7Gm\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json index 3d436c85e0..2845771a80 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_929f8d5bec1509c88a91cf9dcfa4707c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"eQSYFUkvRYwgJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"QOU4pJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"560kj20H4b9PA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gggULW6nZEjpns\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DEXM9hy4l8PT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7WGVzlYnHz5ob\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"EFMo9JuLg8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"EEstUvBpWDhn6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"JHRcRp9I9MROJ3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"voyt3xMXG6J4E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"tu12hPI8jK2wR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lNu8hfASBXtuqNh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ASYBM1UiOyrmsJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Kbb4nyg0aDPQS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"DmEVpej8G0T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zRQM9gSmV9kqB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"x9V4MHDXfLAqi1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"qHbIIPU5uHcokqs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"VaTbf8Ab4mpzn1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"s2fqK7Oh5Fl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"acYDaQfleKzWl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"kyR4ZIsfqJQ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"SC2DFXbTzAtRAWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"tL79pEXnWzsVkR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"gDnZeUf7EK2MMk\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdc430048194a66a25830752ee110fa3691ba9479147\",\"object\":\"response\",\"created_at\":1758707140,\"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_68d3bdc528248194ba84c67db78fce890fa3691ba9479147\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3rRpyqFIfrgIuE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"D2jw0X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"9kf5U8kTmZHUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tnTxqK2wbOENTB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HQDQkmZk46db\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gpznIXnCPk2TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RHYjLjmsWx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RkX6jwZkL5nvl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"eDuJs4ENWU7fCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"c2fIyOrRIC797\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mlYKK3J1DS9xg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"uTeDRcRiSAjf9sP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"VwrMsfp6mrhaf7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hgQvm6q88uIxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"prfcryHZU0D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eVEpDyoyiDnkp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CvoIGATdYKSfwov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Joc0hyyqeTm5NJq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"0jKkbIIJQMt5Cw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"CtOMtXIKTea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"3w9KA6MxYt1kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"Inz6Ywkqcg3y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"24qxPRv8ioazIGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"84zCqYcwANpZ2q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2aCP0lIgCc4m5C\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.json similarity index 64% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.json index c8e28ca8b5..f2938a0208 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_e234ef5080ef199082d042c16b41cc2f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"B3nTBmKGerx6jB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sM1mpQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"v2POz75iV4RsI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"fdaqe8PYxxWVOV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"je5hNjr2xseZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"n10qppaCXXUdT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"ec5lg1sOe4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i0tCn2A1YSrm6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7DgyCTHFnFCCCK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"QWGTvLbozFOG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"1rNrn38d807Uy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"KJ2K0xsC6ffg07U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"tbOh3QjxTbwy3K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"KKh0TlZV98gkz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"lCtnBPgWNKp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EmRiF4Kqmada1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"17DNQZQFVqRE1b9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"mPXpF4PqZHFhB0W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"qjw4XD1tBp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ztO7Tim6qzRfAzl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"gn0rjc70uVaJdR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"JkFktUgeys8x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"0mxXtghoEDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"vvsUgI3lk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"WvANn9Ot\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"P75xHSAas0h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q5g2T1WkGb8sY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"8yUXZpX4S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"AKLy4iSKBEFViV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"z2tvRmoH0FX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"ZFjGJeCBSwU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"g6cHOMrJYOqlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"ooiOftpAsC3t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"2bujtJhCcwRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"xfTeMB4cAQ51N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"990mbyqMrBs86Qq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"TuriptfEAY5r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"0XJClzbhc3wP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"Ef8R50zNw0JMRh1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"hMzjHVl3NwyyxR5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"X6q9HtNxj3ybLn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JQn82A6ay5Bl6s\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68d3bdbab6248197bd9c03e79bd36483010e0c13ffc98c0d\",\"object\":\"response\",\"created_at\":1758707130,\"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_68d3bdbb27688197aebb2b879ed936fa010e0c13ffc98c0d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AKc8tJeQgCWqFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1ggHWt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UirbbE4ZZFQMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CL4ZdhMUBM7WBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"OGPQVBNGqnhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"soRGVqkKwIhhG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"L2H1oyu3kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cX3rWb1lDYgCt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"tsQc2c0Cyd39Uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Di5dBSjeOfSGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"f3J5ps6s3LQ2n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"3bqJR45iBo3nH6i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RcedSU8WpMyZnKW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wuLRDwr9foU7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"kaSA0zu9SiP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EFe5OZFmuJkEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QTknRs7wHJ8BQ5d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"b2mCpgXhIX3bEyU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"9KAIqu8ywe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KCdbn7jrG2DpUPl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"GbixbKi6ye82d2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Qmwxy5joE2sm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ddNWjAEiA96\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"LkkXiPVDf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"4tLGxz0Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"wNl0NXfOm27\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OZ5oI9eI9VYTq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"jgsMSulnY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZQBmemRqLNaod5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"pWRChliFKzO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"rwEKTx8MZ2T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"a78Pk2FuLydxz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"HtHYw5dqASaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"TESaEj4E7LiJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"n5v8IHQAmQ09m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"UxUO7xRDhYtlkJf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"dog2fErNWKVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"c1noB5fPNSG0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"DRcoU6m61YWpv3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"A3NabEROJk5jXLZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9fz2mrzuwgOFmE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"eCRhKbqO3QtKhM\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json index 684aa393ff..ae6eedeb05 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_80d1c8e8d1c2656834de79b388f2344a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"qSS3qOGUgKIxz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"FuBXxi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"SWJnVnfFzA4uW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XnpmVgjtVYm8nf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"n51zNxVrMPE1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kfekf7P1MYDYB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"kWARpWhkyC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pAMJkI1oscY4b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"0BM6qYzbqYek3w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"zgnVEjiUs8Nzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"9nqXs0OdCMwXM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"OAJz7OgrigI1NaL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Omhvb1wAGK2ajsZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"89hZaa40THDZU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MBYt7RmOSQw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"KB7VuY1DOdKCW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"gmK8viViIZN9cqw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SALr4K0UbTpE5VI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"lQqv8KNy2eorYbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"YttfRbzUoNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"YesFsZoduxLEEUG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"1ESeSsbhMOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KgGDWyYAnQ1xvDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"GMYwQsxgEYk0Eb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"rMMpNUvyBKghF4\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdaaf6ac81909faa32286b05579501fdcef6f3ba5bd4\",\"object\":\"response\",\"created_at\":1758707114,\"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_68d3bdab5f488190b5eaa75066ca32b701fdcef6f3ba5bd4\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iruhrNhxrz65wS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIKQRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"kjczoGVH7GHkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BZ7SDwHJ7Bfd7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mmTcq9SUySek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qeWINvAl1kzU5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9ZncFWxnrx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fdorwYhWIZAQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"d31RTkW5EkxsQS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3CEeMhleYlWV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sw0F5MCuaKTU8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"EChk9G2SPmxSmyR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UF0bsgzYbi5wUDF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"zULuQFaaCFuUS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9PtoeEASQh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gixSNk82YTSMN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QUl8rngQ9icKCqE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"eacCMw1k4Krrg74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"FmWBBIkeMsfVvnQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Kr0NF0tRiYo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"3LFhwfta2t8jCWo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"46A4fuEUxxr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"0HVGNkkPWvoMSaD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1UhXtCdNzuaXhp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"B4CEnW9EiKuT3M\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json index f9f5e01cd2..92e67d5512 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_c363d0ef2f1d4d8cf3634807d4d9d4f9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"b76fRgtxcDZoqJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"LwsBS0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"iSTU3f2ivWmAB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gE9i88pdwZS1Rb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"yB7a4Hz5l52y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ty62tkyZu5I5w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"lawmvSRhUP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"K9cF8y8JS8DvQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"wqQ6iWEVIntqzj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"aExShaBjMPFB8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"MahcIhp6k02Bl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"XV5L9QXtw2xJ3oX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"PkEMuT6dS4s7hay\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aR42pbtH7xncx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"8d8gwvaMjYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PSPR4xjOs6hbO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GQMdbWZwGTUFzLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"kZa0ybq93oMoAIz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"fWmciII2iX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"BRU2Gi5dAigVY90\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"CcogqYxmMrBSkJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3QQZdk2fz8nh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"h7uIAfQ69xC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"ypo4HOxp9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"7QZ6fEys\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"m3kLaf8RNUd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"jZZ8kWIdBMk3I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"MUhIZOaHk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5wRXmB9RQ9AUBa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"g1ZsCR1B1ZF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"g6jh7ST8n5B\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tISk4AWxw6CLX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"WAD0Jjz8tzSJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"EsRIdNenMF5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"py3IhaZtUfPbF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"cDcWuaXgufayrhf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"7uNsfTJM4xGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"jprUIudXQpkb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"p1RmVRthC6poPVC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"BXcdphvxTFcUCo1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"i5veTUA3sVV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"01B9DF5FBvCX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"81K1tb5AHWEr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"1n5Zrc3V88\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"nMPUpMqWhReVOZf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"MrOouTAW7tPcam\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"yh5JKseRUcow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"HwMNB8BbHO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"O9Vlg8EJZhtyS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"5VMLyB87PGx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"XIoT53R0nbzN65n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"rCvy9l4flB3z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"qieS5U90PKo8MuL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"nr5rUXtXgpqEjJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"qcBXdVtz6ysRlG7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"OhO4idlS13PyEx1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"LHeAzFOfcltai\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"vH6oemFxt00lECe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"c9xKeXiLXEh4IM6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"vVgHixfYYdxiZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"p0MHAAZOTptESj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KYEE7Sm3gY0mm7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X1gKuvvH167\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"ma4P5hIxAl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"po5rTCHjZSc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"qBpf5g1NoYkDt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"hzcPvjQlkd5i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"G9rx85FfsuI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"g2Jsf9XQBDT8j6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"js2mDmOuJC8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"MIpLw9JIP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"L6cz7PqrCcYjD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"ibpT6PcxgDY5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"iBNu1UFebeANgy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"nYkEg6gMdut\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"B89Sa1engkf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"qLIqA4DLHULH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"s7cg35s4G3jsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"OeijihqHF3KVK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"hV3ewZHDPYG4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"kbcgF2OhjwC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"BNA7oFWO5A1K6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"UlBhfwlV422\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VYxvl1QwSSutmCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"nf5EoNK1FIb3Nb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"pYp2Q74c5asGxj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68d3bdb3fbcc8193a2f9803bf9d7e70c0026aabfa3ac5707\",\"object\":\"response\",\"created_at\":1758707124,\"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_68d3bdb487ec8193a134f9e47e8f6efa0026aabfa3ac5707\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfVBTiQJMSTIoE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9HLscM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"f2AGOLzPFHqrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zm6ZMYGh7QO3UF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"scAm6XEGoPAY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5wgcv5m9zlEGF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5NqvkCMAGr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"G8kU9TQ7hihjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"kLBm2BpkDaJX58\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eRAxCXKVXFLzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bQPDWnLBcrojj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Mui2la76YlU3r7p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rqJcXY87J8BInt6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"85TBEEWuV0EVZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"FRFjWzT5WhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8mSz2yeZ0J6fF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OzHfPgzUz85A7PB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"l3hMCOBsIIEeACf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"VtIeQvcrHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"2XVAs4oQfjITJPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ABGYXtQABksvko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KREFIdFcaztd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"upt3AhKSKu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"zl2tG0Cu2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"aTvDGwRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"wovV1GVOh66\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"56kS9ZU4zli3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"iAwSsa2jh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eH7lmQdyKfHWI3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4TE1XyA2FSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"177DxVw6Dbh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rIZY5hQOXVbCC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"U2nTMh5ZqP36\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"sFV1Q0VDG69b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"UxVUWGGXxkkl6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"VtLXdHTtCvBvjGl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"zicW1YwmP8eZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DZ6Ek4FXkn9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"xQvKPRWCzkxfpZs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"6ntR0DCXtJeX60I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"C2SUzko8q77g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"zNeHWFnyLuOK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"BM5kY9JhiMRy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"1LWpxqoZWg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"YHt93rz0hjx0fTZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"nGZ5rITjfi9RrL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"GzwWAuwp8wNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"9dgmnpOUBt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OqmxuuhOJpMPU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"o417aLskty0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"GxSv2kpTt4NHsnG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"cMuDNgRzLFkl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"SLtxzVPEZ1QesQP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"40NFzoxKuj4cBY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"rfl03T512yKZnCD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"BBl9ksIdA5X6HP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"bICBProIsXJLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ivpqzcn6qXwca2M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"pTvv0eXnDNhdBzN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"cvWQJkeHe4G74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"5PyYU6cnPrIgIm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"d9mcRokoIGkoyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ztLBlvnjJWQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"zDpGJyBKcK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"FBQiNiwaOSI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"G3YqGC8Brt2HW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"1jqsspjkJzki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"Ku5TAa5vxOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"hJA70hLY6oHXlN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"LL1Alpe6DaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ailtlhRaFX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"QDkHaVE8AFkYa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"BOEQZlxMKFp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fpGGrpqcoykknl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X4ezlkbBgkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"XMGgX8DHSZv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"IENuDaB0a7wm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"sXpomARks3HYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"S0j5Nea1Ahxm9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"DVpXSsAXBcTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"0K3EdVBWd74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"MA8gxDn9y61L9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"hcb1s2pv6Im\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"LPHiMNuawXbhIoO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"EBubykbmbaTi7N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"siaPhqGmFWa2oG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json index ddea68c319..c00fa83198 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_d9c8e71bc14549ad598958ce78eb8523.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Sw7JYSs8yAPW6d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"3DRug3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"pmhMD90ClxVgX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"jfwkAHeY1r7euR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"vw5LGI2k6lGh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"bK9NBSz5pxkjO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"v0rUh8uolO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"sv8X7pYUScZOR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"fcKlYOtggbXPGC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"W3yWQTOyuohF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"RBPe5MAV1J3C7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"NxC14gr6CbjTmjM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pkIuIijOLmWezt2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HvzuZNkQoAJov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"stDsrwMRHqA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"bEokXG52gC7du\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"MuM5VYJVYnj5CYn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"FTu74cSNnlzZWFw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"oCwMM8NVLv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"jW1fWc5huLi7WFd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"5GlF0SUEAgIT9x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"0FqEzMl3zS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Glwxt8MhsUeGGnE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"4LgQst9UvPA7j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"7fn1nU7Ad7G3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"qG3hCdZr0sSw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"SCJ5UblWj6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"BbvOiay4PlVOSzo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"TSYBsFmQGO0Y20\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"XvvD3xypG705\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"lTT6leJ0gT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mlpegkiAUw57H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"eHbitlbqJc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"SHH1g1hIFmG2F9W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"gvYs615bN5xF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"1jlmClmNicL6cux\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"CDEjYVdiBtfroJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ZNvoeZfdTwbnaic\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"lvVZk9wBxZpUiyI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"LsPBDkpgtgjfy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"tWyP384E9kQ7ZYt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"XvAY7fze2ORlEC6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Qs04lxqEDTKWD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"eiGiSQuEFzF3gi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NtMPv7mvD2Tsqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"JHmRgUM34qg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"q2ZNGhlnsO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"tkbSCuYjWTY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PS9XX3uCOqgWO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"hQyvVmU6VYUU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"JJ2ojQnmVRD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"94xWofbe4SJK3x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4dYQLMD2utD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"5nmTXB7chr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"mAjGhRn2hv5C4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"ZRhvyavBB8oi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"oyni9K2Z0XDMb4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2GoExxl652K\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"Fv7QPCihWiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"neQ5omiyAPeB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"dpAmlvRQU5fGA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"R8kbMznHoeWMv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"vA4e7RLhQKJJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"DNpSjhozx9l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"bCn4Cao9FBN11\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"3JkXC7RwPYL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"kIDz9JYXgG1UzIR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"LP8vyTQi8Dd3fZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"m5rt08SbTMaaTJ\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68d4c27cb460819095e578473394dbf7096c2ef28c2000bd\",\"object\":\"response\",\"created_at\":1758773884,\"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_68d4c27d34a081908811344b9aeb8953096c2ef28c2000bd\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4bRtdVnGJugQ0d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"wEWDbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Zxfo3ZwdRYFIR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"P0IleLvt9ILRJl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"vkigZqp3JsnL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"v2OuYIFLkv4AI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"j2Zmnp4C3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DM0bXfgViubyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4c78io3PhGRGhQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DOxcl9YzXWArv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yWdEz5e35WKqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"wlyrfYKCtIAOlsc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Y0bDoRwyWIoQeq8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UKykBfOUaeTfN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MmVsBTtErdw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"egsMeUUDJfvbh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"stvuGtCVNxelHcZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SgsgVkhqUN1YzQO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"mUrorZb9hc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ak2Dobfa5uliN7e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"KFAZBKuKUE3Bbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"PHKo6Cc3iD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2mdXHkg8qla6XHb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"WdQJHTFkMrQlS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"yhJ9w45DGzGV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"gg7SQXBBfieR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"UiR2QRlprN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"efzqC9W2KvuGwBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"tGU9NZhpw7SQVU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"v70Dkc2tbcsw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6s2FoV5kdD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cHJ5UcUYoWTDQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"3zQjcUyBtOL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"Hus6XoI3N0vGNan\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"xcBQndUrhKxr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"q3hEmmj9QWIi5rw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"69dPjh8N4BKeLB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"HxOSHihjDDXVRXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"SpsGrZw4p9i2966\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"77ElQkqf7ls1y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"spoJATutAKsp4Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"6swglIioVqXgQSS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Dc9T0zBrFcGiG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"NCQh1jbQ0lgVQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KzXjTWHEDiGlDM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2QvxdpkLGcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"OizswLsabK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"aXooKEHGf7G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"4NzZtznqZqsc0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"rKnZNqHJ1mUy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"gTh46NgZ0gu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZCh5Xx644gGEW7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"DlhCv6GhD4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"i3s0ueUMpa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TdGv3PJy6h6i7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"XHiTOaiooDnC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OBAXV37rYubGRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ooCDau23vQM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"sdz3jVXtaDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"KNh3cWr9sKJp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ULdvWmh3s7rpB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uodLwehbUnF7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"Rl4gGOwlf9uE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"QxqptfaRNJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"Bl5fnRF4kEDSL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"DvAzXimVrIP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"KSzYq4mP23D5UcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ULfHEa2PTDi6Rm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RBkfRMEqXx75jC\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json index 181d894a1a..82239fa96e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_20b6db0a713d475547adeee41f24da94.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"9PII2jnbg7eFCL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"944LS1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"wECxNdy7d7Wt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iTi5EsCGIeDL1s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"68acWUaipRvG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"JKUn6RUh8lUAp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XfgFFC1vd3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aHg9bWk3oBQWT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"PnPWzq0AytJVj3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PBOQdShig2bSa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"2kDEcXvxgGlZx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"oXX0PuUOA4oocNT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"3WrIktthqfwMimK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"94AlQh4BlD7PK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"kao2WR2i2c9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"wxDgd4aM6dHjk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GmgO5uxupt4XGiF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"qZ2FVrbsCshEteA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"HnR372N3Jr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"k7hSkD2OBc6CKt9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"4rVbaHWe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"yuyOG1en\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"O0nle4TdJMdg6Fd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"UUQb5o5DajYnBj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"jw1gAabGKprFM5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d3bdafd3cc8196a5b2ea1cff5d0829059dfd4e79f2bc26\",\"object\":\"response\",\"created_at\":1758707119,\"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_68d3bdb085808196be52159130832bdb059dfd4e79f2bc26\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"NqxPsUz499eP4j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"M9oEaK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"7i28eiYahnnYz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hiD8mHKnxAPwhe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QlPQREHJ17Ln\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xfNjqRw7oEzNV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IJfTWUeFvz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qelset0JkGsFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"U8USgSiNIMoodO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"koQC4lc3nFsS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"B9QHmas79Iisz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ssQZCAgup4GB5Du\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5Gy5Iqwxtl3VIlK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nJwEzXRJGP3qr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"C0Ajj1aBq3d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ow5hSnRfvpy6A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OK2ZQ9ok3nakxVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NvGFhP6mslsu5PM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zJfzKbL8Wo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"iQsgOtAR129iE4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"eUaWyWbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"4xfx2a2U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"lh4HMIwHIb33cPK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"bVHPNrSQYpmEWf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"H4BuMMP9NouOcN\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json index 809508de1b..46440d1e7a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_94f0b12b9b22b4d4309401f9efc0a533.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"w4ks7AWR4z91cI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8iG3EP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ax5FAsQIUVgKA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AOfW2yiImlZotX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"8pZxGolaR7lg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"19Z9xjY71iMm8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Rj0rxuqZBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"86gexCiv0DVaB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"iiVsyvsrYgO8QH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"y4T6l0REaSg9R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"q2I0XdvmzQJbE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QhfCpa9wccur6GA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ldhaQWyv9RGArgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SKTsbA8CoxSFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KbQXC9d09bu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"khbIBGE6uTzC0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"qZj1YXHwDOA4Ln7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"12TRNHfBYLKP9QU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"S87bogvrAQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0G9XWtYsmsz0Ad3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"lgUYRNo9KfRT6Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"jSQSfKGhs8c3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"xisGEVxAnM5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"xAb1zAdyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"xLEGyhEq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"V14T0ifMmAU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PRdLROz5vasq1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"szexqhMUn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NGVD3I4dlZV3EM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"iwLCDcfRFvr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"jrSyoVUoQqM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"wcYBuqZbZzmtX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"Vdokt3lNKzCS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"MA4YVNwkrBMg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"JC3C0rDrVOaTG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"JyCoBhP6uJNG6cM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"mICDfCo03aKB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"q0fRTGfIX42z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"fOFKFncLRHNv8hm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xYluFlHl2zpoCNi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"G5dIvfZlu73zGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"Ov9drZrWJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"JqoB807D8S3tYuZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"szFsj9ocucBWs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"a1eikFXT5V9N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"ZBa8BzAZJN9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"t94KqHXrH7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"g46f2jSyuRdbLN8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"39SJWPo3PmJPDy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"IfJ20DZWGG61\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"VHJae45Fji\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"PLqxCoOGovTst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"ZIRrGKHObUa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"fUS1M5yIeDkJy7Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"dECBGuHTZxhD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"YHj52GBJtdD5zlf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"lTMW7iP553BAmO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0y2874zkbLKsGcT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"D4BNhL229n2z9cm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"cWt6CFWBpTzCh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"JuUhB7tjKBCmNc7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"nO3ai67PsoDXzr3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"6RQ04TbPTHSJe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"8BeuBEM7qjFJNg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"7O7FujX1T0PBrk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"UdGRW08iN1e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"IQqjSjJa9D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"dIJfUDrBg5J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"DVCwb3kQ2rvdH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"7bZdj5Sp6DqH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"HrAwotLSzNJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"chwNE16LyNcw0C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"Mo2rAr6INkb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"RfZZuLwcf6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VxkK2HXqTZqLe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"F5axVO8n3yh5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"knKpIeWEdB90wB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"YKS2CLRLJbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"m92snPXArUn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"KzgIJeFmL40H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lXo3OuXrqJ2qN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"z8Z5wcI3QAEqx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"ZkqWJRq5N8vG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"myK1BL1HpY9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"Yg5qPFUMhKK5W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"1GwqThElnsD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"D9SWQtjOJEtKsrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"MP2po2IVFb39uY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"8Xuxr1Xow5Uh0n\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68d3bdbc218081959eaef85857e2293f0c8f20c31749ff88\",\"object\":\"response\",\"created_at\":1758707132,\"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_68d3bdbc7f84819582c22d79dc36e3a40c8f20c31749ff88\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"sIHoqlj54kItK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sFCAuH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0FdJDMD0XBAIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lvRM4twXVMiNkf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"k3dnQTQKRFlD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BCJDpobrjmILY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"8J92KP0HpD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5YxLIWbUqcez3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ygGTXeVrHlSsP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OoTBxZiGfaAIV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O5jrlxVPcsn3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"pOSScSe5cT4CWsS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mYsCPokzQSgMpRq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0B7MkuTa3yJpN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"A1cuqGcZnJB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"25o4GqheyQbtM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SWgpngeKHmBHLmX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"uhYCsOUq9nc7vI7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"xtPUgZHScM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QZLbRiv8Gi5qlSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"qjq2hFs2ETmzmu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"0BkVuUs6DJGZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"VzXN8JK1jEC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"1RK8SmYDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"A5huDItH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"cb0DBm2QRIV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eGyw3MpeHVS4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"qnE6bK5Th\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NwNXNAkc6Zejot\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"C1QCFydoPhj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"SWIboB71St7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kL9MVfQOvoG2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"gqUpkMuRpXcA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"tAGmoJ8mJ8yW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"BVo5Es5IGQX1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"2Z9Z8hkbxU8ChAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"oZayNH2Jv30H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"h75I154UKZuZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"XrPFLhmnDnPhCJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"V0FsJVbJeaCDuj8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"eiyUh6aeGpOmK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"cLtLSTL2kI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"UWqQlZ7Vo3zP38D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"r1YwztEPLgCMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"N7zAx4Jz4eUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"h4gPIU3ZRcKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"v43CjNxHK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"3ygvEKzAQpzLx5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3MCShYvlGG13FT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"c0bgwNRHc1hb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"8rVXXPvSjq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1mYgZTdMXjEFr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"1BU0NvR9znY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"25RZsOf8hGFvXv1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"G4puyRwXhwYb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"oTCSefzA16C9GyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"ucAfevQ7un3skv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"m7blZm4d9e9S5JG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"4Rf6F1vO1ji0Nae\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"haIBi8Hehq1WH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"43l4bUbCKNHyAzA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"1oKiFdLDtmvuk00\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"2is88hki7X8UI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"h9DVbthtSNq6GY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1ynCe0ILf22oNK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"55DUzZLrWIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"XgWZRdYWQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"EVHWg1nOMUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tNGWfoCfLZBVn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"kjZx58wIc4tA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"qAipG8EZkmw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9arFZQ9ekoQOVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"N7PT8Iwou7f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"WvDksvtMDA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tcvszmQMQkFM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"dBBbbZNzHuq9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eVfdQ4qXbYCBkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"oFSwSDTKZOe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"Gck3bUJBUFm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"wz9cr1dKCeLK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"UGzwjGwFap9GP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"e7o7aFaOUjdyo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"uiQDBDS2g1rR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"zRdIGbf4IBQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"2rmzkI1MAgARP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"dfcDFKfk8QK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Tuqr7URkNdYu2rh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XJFRL8naii5rQm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3A547Kdl2I2Etc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json similarity index 55% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json index cad2af6d13..6277ccd988 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_c6781e0373f28bb83c2fade34630129f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VPB96JdDfYLCbV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"UQigFJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3dlrdSHewoRjI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"h03nAZpXxxLKB6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"gj3fu8VaJtdO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"cFFVh62jJ24hR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"btUuyDMESr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hguXHyhB7qScN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bVC90jswxsJUtr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"e5d3W2QuXpiUr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kxtsf0nAiYuCM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"DS3DSL6vlRaCnxo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ymRfuTLz48wIeS8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"LZe47aSXpHcaz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"0dfx7hUQd7p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yWdYXXBXC6E3S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"JkjsjuVB2XwjVil\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"9wpYbv49d6Jkjud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"J6SMqJUTtVRv8Er\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"nXG6Y2BgYMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"iosRGLCVtzrxHxb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"VArlJfn6npz6jJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"uSNoWCnQq1I8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"QQZvgKDUd6s\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"S0d5wjckF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"T75tnrRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"oxTuQndEgoo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"lLDtlu3ZtekEd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"ahVvBxyPg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"q0nylTFnnJ60BW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"8twleqSdVxH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"0uyPI4THob8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cMlHXytQ2b6bY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"AwGTk3Pm9A3m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DGVOUHJakPlz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"tqkC6BDRzEAyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"o0WrovzPG1Zq3ZX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"02m5kF73YqQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"m9YSq8zCd7Vi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"GyZ7ajHGw4hktJQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"WPxnFKrBLN9F0pd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"LZ64z3DvfHTuIh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"CvoVLLCozT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"cUDJ9qBwJ4MxnPA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"pPgmAOvUx4iHj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"WcowXviZE4y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"FND07qGJn6SMT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"39IcuBjmOrYv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"JHrUeJFNZwGTVof\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"7N8AfkfcEpTgMa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3nostZGCwx84\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"iNSf4UjKQI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X3GKYp4XroSkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"4quU1pzdZgs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"stajwGpl3mp36jY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"R8jq34qHJheC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"WWl7xnXxwXjumxG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"zaIAfZcXWAU6p5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"FIbW82Bobi2arod\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"yt5MKZd2Ax823al\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"XEBXg6DjQJmwe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"y270hojd2KfkZLd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"60DvXXOZvldFDr0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"lYDC7Ebtbt2x9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"FWzydRH3k3pX1Q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"nXm3R95vKvj6LP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"KWOPc9IEyZF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"gxFuhblmkw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"p9dny4R4elY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"a6PnDECOLdiHN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"DwZbLQvSh4MW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"aRMviJMeswn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"om4t0ZvQJVSOgb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"LTgvKSfLCW8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"Xj6iCcZ0fF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZZGLbF2WWyVMF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"CqlTpUazlmgz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OxiQ5mVGwLuJDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"OIFPMzIoHqC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"J2zFLqDVA4V\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"XKTzcqc2YYmx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"iKfSbbCo2jyE7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"678eDia4m4ocG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"sb9mp2gSeL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"KKCc92p4S6M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"krH6z2DZJfMp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"pI9IFa12xQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"DdqJ4teDpU1SGtg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"4SKavnrheDEbo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"6MMfFESt610GF9\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68d3bdb1a57c8190b24a8410be895e5d07c667b48163e57d\",\"object\":\"response\",\"created_at\":1758707121,\"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_68d3bdb2a9808190b608c5b56dfdec2807c667b48163e57d\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ixkZfqqdCWFKf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9WZvqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"R4WGb0qlhhg9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lScu2AJ7HwdAau\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"RfAGDDDrSek0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Jx8VzI8adIWN4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"D1VZIZ9cxI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aYmCcwiuSv7qw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mCYTgJtIeQICbA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oYmNjDQCuICXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwiDmauAQo5aw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"47aT5SnEiKQWdxV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"DQgPj8gaf76LNs2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xMF7GMrIvqFrw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Yk68wsF2Q4J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jMKxCGERK5H6e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"8NM6aHG7wGnk4Ja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"VeTtDhql1BJEwiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yACzSTvoX3nJ2xh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"rzNYN9o1Ams\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"4b8Xdsr3ybmGpKv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"N6l9Bo9pL5azyi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"TUpJ5w8Q8BrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"bxxzYJfrvdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"JXwos5gFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"s6RPsI4w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"ArJvA8qs7Jf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X0Ffa2j9ZsE93\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"RumkKrEHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"HJIwtYtS7Ae6Et\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"be4o5rxGr4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"5QCDBrfswGm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gxUASruzoyzF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"3zO2iimLQMrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"qhHpUckZT1cg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2lSmIWpqfhUYq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"sj2moLXXa8WYKXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"mf9aSHSmtMXG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"JezOir5PuBo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"kRbRL6pwJt0FnEz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"R38nWhBTqZGNVxY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"LTdCmfMA1OTWxk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"VwtcF1p8OV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"E5sFXPhPX7R2OAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"nRFeWBgPDpq3q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"Jt0DSBpGlhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"SYErdhRNntKDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"XzRO4hoD3yd7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"Hs6wM0xyNrTJh0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"zFFLUvtrX2z3lx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3H694tshazlK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"25j3dV7mMV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CwOBQVFGRhGFr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"UiAdOyhZMdW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"KhNPFgIxuE76de1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"3DP15MQedUrP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"TcIA34HCuZTfudL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"dlcXsyXMMb19O8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"dmh12xMKRQd6hNC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"DWbW2hBcCj4C4v6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"Bc57OdqTKmLra\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"57qVsHLnBYKtgRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"KntpxV8oSectUoE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"yzr0VLMcq42eA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"lEGovmvRGz0B3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Di7FKJapWmc3fK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X77IaOPFRe7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"RQSydYztNs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"8Fx1suKmyEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2CqzFJjsxIGSs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"kxjneEUFHv4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"8PFzJHkLYOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"RjVg9TwlelTVIi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"klBopdWrsD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ntYrF5xJ8z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VAmOp2CCoEHH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"fzH80n0IIko2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"D3FbwrQwrUIUo0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"XE1LrZvGfEh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"1dSV4YqEqus\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"S80TcGETVuGn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"78SO9UEQObvNA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"qnHIEMHCS4Bp4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"f7cZ9hLN2Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"MUAbojeG6Yv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"F704tD6ijKmY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"d28gqzpFfZy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"1Og89RU7xtL0P85\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Vt473ezaYkDPCv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"FaHl4KrTtiAemD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json index 3f1776d7e9..8422543569 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_a8ad37dedc518e45cfc4606b5bec394e.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SloO6QkqlYqbz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"6SkgeU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"gFQuPDmdb1ym1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vGz2e3X94syxGE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tEfQ5r1v20PH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5qJRixzyvZWCT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jJ77kDNrNC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"St2i3ROuZ3yXB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qgjP4uSHQtXv1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"9WIFJwWt9MLBv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ZaWLcvFwFwldR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"DcLtF4obfhMazAt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"F7wNBMn0M2OmpKY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jEtJvjHTXRVAi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"LjEXXoDzPAJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"e2tKxOnxDSmgC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"Z3oDmmgNYtTEdAc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"8A1XaP9yhGK9cW3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"AZXk341YXpV48j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"DDhVuAybGq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"3aD7VykaVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"bAkLFpOYBUroW76\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"tPHkWOkxEH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"8MWI5LmNNJyZUjH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Oc0EGyjo31wrFN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"P9Vc2rCjySDwjR\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d3bdb82d8c81958369a0f57d98a818061f3bec841ad5c2\",\"object\":\"response\",\"created_at\":1758707128,\"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_68d3bdb9a2c48195bb6fbd86a12eb4c3061f3bec841ad5c2\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"P0u1nI8qIJyrUv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JF4IPr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"jK2KxqpjJvRYq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vbS8S6HmY2tgHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"M1Pta75DotGM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SCHwsLPXGVNrH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XxUSzWiyAT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"f4u1Q5umY6GRF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7cQnk28MNmMMcZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"sZeOtnu3hffcO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FDIrTxpTXAF2f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"9X9Jzcal4qKTllv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zZjeBwQcCsCrQvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NKvezm2zkNe01\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Xqeewfnx7mw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"c5W2FrmXspraG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"WCcC9FrzfVBXaN1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"GFEyPpzG50lRGwa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"ceAcTBZpT8GcsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"lZIpycxjLd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"qaDrDcbB7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QdGveVaFppwBv97\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"JzXJr11cEx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"YMEOng25cfL49T0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"6mhKZJylAyOvAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"7NadnKoR7QlcTB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json index 114b3032ef..6138853ffc 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_49918221a90bc2d25a1288d33f718530.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ghuqazEQ1msXa3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"lIOcuc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"5iXAbZfPqNQsM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"2tO15xL6k5zzX5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"dZc1OnyrTCBk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"w9WbWVS5FKKqX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5R1VeY3KFq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pLmd9lawh8l3R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ezgrMpz8Od2OB5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WajA3jARWSjtD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"AQnNmmBKi5jAH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"82oGstXA4ngqXLO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"xiPduLrMV01Wday\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5FDwgEwhgsFxb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"KIn5Ow0CZJr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"vXuXUzoVMkGFV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"FodvH7wCTHDEuVQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NQ2lShtX6X8dceH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"YQMB1dNwn7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"Z3EUYeUHqBRth0f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"jO7ku3oGCrXPXc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"R7cM8ZVLeE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"gdq37o1dHeD4dcy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"Rf6vzzXfMPO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"VBw50UfpptOeVLD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"QVHLTOyprnokQB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"U29wn01W2yUSXj\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bdb9698c8197a4f3b8f16ed6a17207283a457c1b124a\",\"object\":\"response\",\"created_at\":1758707129,\"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_68d3bdb9f7cc8197b34c6773d4c97ad207283a457c1b124a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tFRth1I68LV0g9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y3yoKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"BkVypbIw1aIsQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Gt3t4D0Bankndb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"w7LUUSok5QP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UwCLtfuzSUIiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Lu6Fa4ekR4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"B6Hlhs6trh5c3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"K4T9SqldFTdjYu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xAu3bs8oALo6k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bSo9D7mCPylVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ZXCG0PNGAv2PVAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ws874lBmcXyFoMU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rwZ7PvZg5ym0j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"NySQlxHJjkZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EIDLxHaBASzho\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"LHPU8SiVVYGMUym\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"K45h2iXpHvhBOtY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zo1MOrpFdu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"MdyPlbQ0DtLpC4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"WJW2ej98piywgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"yrl9jMQtcc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"ZwXR9cP9XWo5Iz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"LG0JvPAM2e8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ho73HwEb7RjV3pe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gK9BYks14AfeD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"u9hUHm8LF3kEmz\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json index 488624f6ff..6a78e2c6be 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_6bec6487dfe642d6607cbac3e3567c9b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"y0lVC2Hfg3Nml9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Vfbaae\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"RvLWkWJWNxBUC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"29tq3GiPcPgW7A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oBOKsO3VDTKz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hBRlRiat6sIBV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"jnCCTRh5kA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"ejrCuhPpFSzXI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"A9ti2MouiGTooO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nv9dwAH0LBR4A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwclAhRMUQvmd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"iEAvesSTtLXr4XS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"VoDaTuiRMwBjsU3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y67BamOxh7qNA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"G6RgJde7ukx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Yh6VO1kuG8dUp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"q84LzfjYqSyzeZc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WBffAGLiSvSHWas\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0tInZXW7DTdYXyP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"gwD0FvrSZhl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"LnY3o8ZAQ56LNPc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"8Pk7hTr7txHaGb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"o7lqFzHa3e6cCg\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdac05b4819799faada363a7d8cd0b7de7957fd56702\",\"object\":\"response\",\"created_at\":1758707116,\"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_68d3bdac81c88197be60a8987b2dc7200b7de7957fd56702\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YQlgPLKPwEcNZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIo1SK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"poxYVhSE4u21x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"39IAGBq47Ehdx5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jGQ8R5FtxTws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OCSqY7Vqt37u0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5eCXDodtAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"h8fI58ufOv578\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Z5jbRR8sW0UnJc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"U2i3O1PXa14UI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kFFe8IeeHQVsg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"j407RS2WPNiJVvi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ixasDBVNN3Od45W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eDVCqyAkX9okx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bqy9Qcsj4RW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RxhANCiu10bny\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6TbpMqoEKT7HrP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xKX7yBzPixKIhxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"dXtHjBRoH8bEjk8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Ev77FklXZRP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"AKUN4ORNgPowdN2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"OB2vYqSzS1YBbP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bh6RKeB8yFSeMr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json similarity index 60% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json index 7b85155e97..f350cd2ce0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_195ecfa59c77a5af5b5ce68d4385de24.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"v5VOSVaNpTeNik\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"gXS4n4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"65Ri2HxG0mExl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfiX33yJFEKmTC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QeAFT3iAymTi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fXCkkViSOsRT0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Boqrp90OLY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SAXiLgImKHsj7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"dDGsheMIfxXYbr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qqqSm0CFXtUV0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"fr8ukq8KpXgdt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"QBsuMspPMGeUjJu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ZIucU8XS8RBdyst\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Z1n8KDTwVmbaw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"jCHx2y4JtLl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EXwrzDt2Gs2zX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"pdK3ncHSt04WYap\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"rTYykRZ4C2y3JC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"QOJJygJAqaYsNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"oTjKkB23xDb5Lq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"eVQTrbjryIgv0pI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"FcWPv2ecjCa8qp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"xjKxdGEcQ5yw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"I3YvKOGe9ad6J7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"I5Sxw8JUso1S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"n6jmw8S4mXHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"XUi5xflEF4hPB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"w2KdnguCUq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Y5EMcaTNA32X3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"lDwf3XMlf3mMd9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"o7YoxMUbzXvOa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"jYkbzkdS3tmBT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"9VdmK15TjFJ3P7h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"isy72E4HU9UxgXg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"9kPlFT33Uc8Fc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"F7nfmitFpey\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7sneAQSu0WJYE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"2YKcz9TfKMtoSiK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"oHjbRBkuicAvHa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"NhCbHHHfAElThH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"8GtZIakzqalAFU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SX1OyfazwG0X9jQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"nlRqR3juNQhy7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"BmSZqaKlAsVi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"jaPh1gw1juIBmXU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"6T3xG1vM9KkF4G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"4Q77o6T7JwlKdU\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d3bdc1aed88194848748d3eafc88e40e9a5f73255536e6\",\"object\":\"response\",\"created_at\":1758707137,\"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_68d3bdc23f448194b40e15cb051139e90e9a5f73255536e6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FCBTfWUBZnew02\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"hXnLgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"jaU0MBoHMuosV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"NksEgH7FiWeblU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"CZt7QAvXwOcV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YEq6gzWLqs6ci\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AhK0rDGizY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Gk28OP2LAqXpy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"aeVhvKzldOsFP9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZEsxXdKrNkiPF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Wz3xgshRbxAza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"5EvAiYo256pKSmn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aogm6pNDk3kRAyD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VP5f1YYoWbApF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"yvC8k1govAN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tLCvdOtx4rElk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"zF9owP7ZfRyEox6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"LCw3RfmLMZm01z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"T0YaKDkGKUUUrQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"XJuOgIdwTukblg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"TYzQ9RQRlN1rDsJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"ETASS0Ih1whBgM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"DZ00dxr08bD3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"\",\"logprobs\":[],\"obfuscation\":\"iA3yXGIqo8o9li\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"uD0nRufHKxWS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"16sgcBvEtXYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MCSsKrQjjBSiW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"b6mQ9Oq4MJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"n4X0e39S6Nflt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"oVQLPvcxQFR82z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ip8NgiUqgBpz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TjlBsSTiBqsIv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"DUK5BXIGMG1aX7O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"6pPy9g3x5dNfs1u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GuFMeVb3HEbct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"NrIx8BK3lJs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1OUD6G0cHWbbY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AdkIWSYI54gz1ow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"T36nmfSSGjQm0t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Js4DLNDBicFPMb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"0ShacPmn08v0W5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SgeDir863N7g1K0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"j23Qc90F7BEqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"5p503FHR7kGW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"j1ACoqHV4qreAc0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"qPd2KNE4chyxOf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JGMHYAxhsqNMwK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json index 55a4269821..5ec2e85fc8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_9beca226d02b25d743b53bc046843d40.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"PI8ijNIXOUXHvT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"O6lkoG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FS8DpXA7AQ6B9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"89lVrAsxcgDO0z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jRfC3beVaBDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1Rrt3mmrjWZx8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"7H8gmMhvV6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"R2TSyoaDoSgCn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"BMHa1UUw4nXZ1r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"7QiG10E76xZHr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mNmdp01Uc16Hu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gkbBCEyTmxUHkHH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"WW1b06Aj7xNdrc8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"QeI1ZVeP4YrUt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"mR7uhkmQ4Si\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"176M97PWAHsTU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"5G4AM7Gc3mCd44u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"tNmAw2f1TLAKUlV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6aJix0Yt5a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"5Znjas44h16Vh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"pCL5tFbgmw1f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"SIX3T3oqlU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"jKWljldlGWqxKqW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"iGj00qrfz9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"PAk1Xt4c97Ek1uI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"FDelKCm1jdxKE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"kw4Hdqwwds\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"PmBPKeN8ARaYi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"hV0gRi9WHL8fR7e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"Ydcpt8OTI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"D9WvFcX4wMFvkbO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"RwBwSvqSbIWvAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"QiDn5JRUEvpNcV\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":40,\"item_id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":41,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":42,\"response\":{\"id\":\"resp_68d4c1fded4c8195b35b45d55f5251fd0a3a82dd4616b51e\",\"object\":\"response\",\"created_at\":1758773758,\"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_68d4c1fecf4c8195a8b31c257755ea770a3a82dd4616b51e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"O72kbULtdzs9OU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Sgkgyn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0Bxjqzo2Blp9m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ET0CfDpVsTTpc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"04itR1deuzLp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fspcR4kopVFhs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QKk1BAtSJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"JfK6ejBEhMoG7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"cGu146fQmbhxcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LHTtE4qJRqePb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"pTEblhR5G01UW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"9A1t4o7mDnAVEHD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"S6FYAJd8hxva9uG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"G7gjGgkwQn6Qy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"LohBLSbwb3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Vdp06nIhgmSD3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VEY0cPMfyr9She1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"EjZflitkAW5tSPd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"c0e7jEix9G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rOzFeL5qmaBJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"wtc5kDI2ZPF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"J8DEA31mGG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"7QFzV3kAVgxsa4r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"XiWxxYatcn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"aCzbIMeRqR7JYkO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"LkGeuQ9hn7Xyr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"MVMDO034Ud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"SRvvP0gpLcnkL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"SH6rFAbEU4xBolt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"7ooQZDUSuR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"Gbhh4i91DUyqKNf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"I69XPtfRfuFRXv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"tuIPpXuZC3g6Wn\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":41,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":42,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.json index edc81b3587..c8c01f7bf0 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_74996aaf1f5dc6926ceb2dc6b521e2b1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"TV5k9QEjuHefTA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8WafxL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"ZxJlLck5cS8O7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"EsvOYBuiadU1rW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"0XWZa6PIZDkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0YHmkohAq3u5h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"j4Vx7P61el\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"u86rNq40wocVf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"bE5QLso00GEZcz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kJq9BhKqzDMhs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3mXk6pTWBXxl6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"niAW09ME8GY1DqI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"u73id6Nz8JjiP4Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xy6qIDbZp1iTM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"2HeifpNBO8i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dnOlcQkhJAoK9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1tgfGugIb6z5qZ2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"TaWwWJnJHbGGNSU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"UzvkO35ULF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"S1F1bSQQWQcY1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"j4VgOHkqYzGQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"q6ZRAca1sW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"YBFfIOzuDzmPvnc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"Tg2vqz6MnE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"qFVNjkyWrJl4Bqo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"JF1nKmTDJLO5z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"obfuscation\":\"VCoRFnHGxmX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"t1blT0hp05LILY6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"i2K29P2Sqp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vsVAwZFQd8h4wNh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Y3CVNBIMoIYr9m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"o5yMqRNWpcoRWx\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":40,\"output_index\":0,\"item\":{\"id\":\"msg_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":41,\"response\":{\"id\":\"resp_68d4c1fe7cf48194abaed38701b0f71604f118087fe3cc6a\",\"object\":\"response\",\"created_at\":1758773758,\"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_68d4c1ff0b208194a841deff58a671b204f118087fe3cc6a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dA8Ge2064GIE7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"02sMAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PX8g0IUa5fDza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"C7bKytEl2G09sf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oYFTu4IF6M6b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tIK96rXcVV4TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QaAKjhSGAW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eFQCNcbkb8ts0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"HIW3Yp7dspJCvg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yX7xSmFS3vuOC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ivLfuT4awhepq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"3wVhrIXMRSZtk9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"N9p95CP5roqOaRN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4WwfBOMPDWyoA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"PXXAVWWYV3J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OhtxZM4dsKdFB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GqUCY3zGwMF9QUy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ck7apSTkTqCX1yu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"whRlV2HoId\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"l6yjK6QtArPrB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"acayF5ZELPFz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"BgtQIbxQlE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"5aRLZX2q9EMmqMu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"TbqRUJNtaB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"B3qojaHJdsFBuic\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"yzIxBpnJdpIyp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"obfuscation\":\"5hlwSCnoczP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"u4jONrCrMvH3JTs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"3OzQIxRSeV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"fSr7qXtu3wM3C7h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ct7eAvNme8ETLK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"DxxXjlzl7ZUYeX\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":40,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":41,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json index f590232382..f5315a9b75 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_559ac20931643831f47c84f41daab0bb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"REDXNlm9vtu4fp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"DJPJ8u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3NgDUHfvRbqXV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CKSi9GenMwoNxp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"ws3nwJ5YBovW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Ur9IDpqjhcqW4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"nJPzxn7Pez\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"85XIo9zARYij1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"qILExtUdh6AEs5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"HoJobUBRweqto\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"dstdL3DLFPdzY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"HFzs1xYWCqVH2oH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rtHOeha8pm0e7Yo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"iLDDflgVNeGFQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"BMZ7dFIa067\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DDzwiulN0kY7L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"IMpbve09tRIXIxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"RBhtQns8CZirYK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Ma4cz7HAjbWQQRp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"4IPqYrVWMpmwStz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"XTAhCFHJWw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"ZUGIXYMOuaOJ1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"90CmyUJqR4rowom\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"zOLDxczqA5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"UJuOH7p2uiuQcza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"AbpB2XejCRWt1J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"r8RW5B4MXQtwcB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d3bdae500c8197b66d99351d170f230a8840392a33cb1b\",\"object\":\"response\",\"created_at\":1758707118,\"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_68d3bdaee3e88197913aeb95b60508c70a8840392a33cb1b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"JaPHwKWdZiLGsB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"7qtQyp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"no9WCoWRQSMCB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LRGDJyc4BHba1r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Mwp7JiwUkI0j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YdNygHqJPHoIG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IdWjLAIaGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Pm7CjjsBgCMsD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"xdW7t3lgXe4uVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PxX5aeYaKtnlc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JXrKpzZEPL08E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"RuxiCI0Y9mEyeDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"hxytsvmCpPesKet\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3ceC3oo22XeYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bxSISuobjZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hXHMxyB056Ddu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"T27vXbQC6fLKKDx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"HBzjfbvPvDDRGsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Rxgzr74zqGonAlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"WNahizdnmjLb7rj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"Z6lvdcEHFp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"FlBZxXygErVxd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"5xQyTYx94GLFeiV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"QBJyuKzhkU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"8UDfGgGChiMQ6I5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"7g64n49vrKkChU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ej2w1lU1hqsLkl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json index 7641c41be1..574c51e753 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_9b7c4f0d9b556cda64777fa2c9912299.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}},\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"p7ZNbX1aK4cvXx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1gD3TD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"lUsWxG1rd35BK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"0bDNZvv0yR9Xsn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"AW8loma8e7PI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"f16GaGhhhxUCi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"vbqU6vBsvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"HfbFDU8nFuvxe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"pOVjpu7qHUFvJ8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LM5bkt0ILDo8N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"3IEf5x4QfSReW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"lExjOzYkuK4hMPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"2geJu0zZx6yr5g6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"pTSgyhMSTEwAX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"CnMYU8Js961\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3fHRHmP3Egt3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"UV7p4gpSdKjNttg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"hTlvozCsL46uEjg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"tp4kUKMAfQ3tbUM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"pXBThZhS0t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ta7M5Y9x1UdLoZH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"OPMq0juYMJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"9f1lxRgWIXFzej9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Onelt52gnOBcXN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"XMeDUjCvC2L6mc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bdad3b908193801f1c626815362001ef2ed2bfb92123\",\"object\":\"response\",\"created_at\":1758707117,\"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_68d3bdadd7648193aaa8cba4fa9493e001ef2ed2bfb92123\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VmDGwf4HSuzVva\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y8FRvC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3ogNdk6X3KbO8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gKeGPcPUQ87XK6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"zu7sf1lV84ZV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WvL9F8VV5pvgZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"n9diDqxIBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y3cPQoEBomlNj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"IqgKVO9QXxXZLQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"97skeqZP6wquR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"YEY5Bsh8r4HE5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"vGq1xxkra6MWSQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RZQOlpXmQGojNI4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Q5Wm4GT5hshun\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"H4C1xoLA3nk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mEaJZJNbTNgDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"NG1IQE3GGseOJUE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"vcBhGdvI2LG4pX7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ulJcH3ESu3docNG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"nHbeoSJwrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"UJssklW2U77FX2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"rwSgLSYpYd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"W2yJSwhq6FRwxRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"cjKvqvAJXKfx3C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WIBLGx16kMRuO5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json index 3500a04c88..7bd27b670a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_184b822ea13903701153170335d38a3f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"sct1S3nioFqBrB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GhBkER\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"Ten5NhWX22Me4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"d3Q1tLyngrbIh3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"U9OCuBxGuDUI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"v892iZ4ggMSJC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"IcYzFEnoAQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4O3x80n6cGBVj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"a59Jdl5iDnE1Zq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"scFhSK7XncXax\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"CwFJ8Y6zv3Jza\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"jJJUmTrFWfJwWN7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"NiNNBaKUFOYqHaK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Er8RVTmzspRrU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"PRp0Xo2KLh7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"UkU59GMuxY3vY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Gc3o0jOFqkORkTL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"FRcmNw5aNubt48g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"pZGxsWzEOpTJI92\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"Colored\",\"obfuscation\":\"5u29pKK8Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"TAbABgDkVMw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"crXTKD7CT9tD90\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"iBPMVzgnQqtR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"FDu9KUTJsZqP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tvFclqgwDfEmN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"hxWn5zJJLX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3qhFrlItGQ8kz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"tVboUdpBAXppmG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"9LQcYqT0morWQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"nIEMTlI56QqWK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"jKcBpLkFLMuG1fc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Dl4fS9w4vA7mBi2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"G43MwTtR7pqc6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"vWZnz289cgI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1tjmM6EE2KFhT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"1jX7jcqAB5qnICc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"O0zQhNBWFiYzLKI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"rXaTyXyqCrRfQBa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"Aligned\",\"obfuscation\":\"vtGT4mExT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ldifSB2bLR8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"vh1ZkUEfXNzCdkP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"uzd4tVGf5hOwDt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"AMvOx18Ih7jR2D\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":50,\"item_id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":51,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":52,\"response\":{\"id\":\"resp_68d4c208189c8190889838ca3c9fed5d0784bd6104fc0f57\",\"object\":\"response\",\"created_at\":1758773768,\"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_68d4c208bef88190b01856ad43337c690784bd6104fc0f57\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"call_id\":\"call_QkGYfrvE7hC6nQyNBGWDCv6p\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DOYXNazHwvpzVN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"FVSfJh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RR2TLrdsHZbx4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"QbMl7G3yy61F20\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Lz0Qj8TwrXDl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"MsU9bMNGzUMMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HY1omQstWa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1fB8t9J5hfOW4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"TIagU2czrszEP4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WXZmpbnLF63bi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"mqDYtk2JVAgrU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"OtopZzIZRas3fBY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"WCzEICgMmxEF0o7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WbNP4nob2zIYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"7qUEG3aBKzh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"z9ETyashbS0sz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"lU596hUHW3aWsyV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"bqvngTE7NYRBIsV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"sBMHSpplCOKnvRY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"Colored\",\"obfuscation\":\"e6p8d3d25\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"D515wasGoFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"Tabz8rgYyjUu3K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"3iT2XbB9HjCv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"P7iGsRuin2tL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nD1rgvZMjs2oa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"DaQLON8POm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"0vjdtTVK3JFu7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wQIOaC4iyHt1oJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"I0jXNE6sGV2nn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"M65D2vENSHwnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"7lfaW0xyABg9qxc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xebQ5BPSezDzhUr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rzBpoETrXRKj5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zV4GjilHb4M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"10gaxcsPqRJNS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"i10TOmXPL7hRMGf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"XcGio6W1G8Huk7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"F1Ylrwl6cyhO95o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"Aligned\",\"obfuscation\":\"pbMyqrVlT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"qJqn3NQ4ZdG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"OEbTTCx7tHt7JUy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"26M1Sb0kMwzxz7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Fe1niifp4GJQU8\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":51,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":52,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Colored text

              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Aligned text

              \\\"}]}\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_6b7b58db82605ee0f2fe5146738274dd.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_6b7b58db82605ee0f2fe5146738274dd.json index c9c1f174e8..8779859b4b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_15550b742875ba5cbe9327ea1e5ca526.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_6b7b58db82605ee0f2fe5146738274dd.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JrURa3cD0uOElS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4XoSpH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"o744h3djpmbEr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lx0zx7ovenHUmg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"05dZa5GkzqzH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Ib4ndr6sE1bXm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"S1nWtBQK5Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"vEpXKscSeyVjJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"l9SWuHOOVxiNE6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zTnuYVJvpxlZE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ccbT8Sv8rEn4j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"YM89uMgntofIxUB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"AkVoMtmysUXVClp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3oG0KSspMKPq7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"2RcttcC2jN0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"T7dQ7JzILrEdR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"HbqHGv94tzYstFe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"y3mw94Gbqvua8Yt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"03MVNMvfMJ21LGj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"1IKtfCUstM2OP6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"nB0Ls7P1Avkfj5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"jtzGFWcDJM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"6Ghy0C5xKkjPHQg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"g08br44ytIM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"WYoYFTcYTLWV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"DEDShBvm4cW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"bRnnCUgpd8Kx3RH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"2hx0GxktaJi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"8yagUle3LtcVO12\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"VN5wcWyZitqy3l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"5B8lU3Q777MojN\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d3bde28dcc8190a42c4c1a1a0984670104e80845729fe2\",\"object\":\"response\",\"created_at\":1758707170,\"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_68d3bde314d88190a93c91ee128f17090104e80845729fe2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"call_id\":\"call_ppRRA728rQJ1JavLOCtLBeGd\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":678,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"fQSLaVKeEqffQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RhYsKt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fuy2BDKcNpAnF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DhpNVmAqoMon8I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"3ONC5naGbuAI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NtelIhyiBKlSu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"aUnxISkBV7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"635ao6ZcS9tMJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"xSbdkpBbMowI3H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ANZ14XufPD2Ch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"O3vjBrju82HXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"P2RqBa8mbboo0NX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"UxuxtTD7peZvDmp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Dd6HVf2bn5ges\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"3N34eMnNC2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1LYWrWvWlarq2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"T0vXsgdghlBwYTv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"BbELTbhK4vAfOyp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"WMyMEZKgiw4Zt8H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"GgC9UzSc7nbS5D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Wm2TZHDf8dUEAlv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"9luylSK8uo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"pRiIphKZUBtvXdr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"olDN9XStYA5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"s2BjYF30YnDC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"yzy1t1mh1qt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"jv09MrYnNFuafKN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"PGDXn3B4ceR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"f8inSi8BTk4RCda\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"Nv6r1iLRbevXrN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"ONpadcgC1RVPd7\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hi, world! Bold the text. Link.

              \\\"}]}\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":678,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4fa98468d00af0302fb35faba6aa2823.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4fa98468d00af0302fb35faba6aa2823.json index a890e53e18..1736e61ce2 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4c67bcfcc395c016784e8d11840d041f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_4fa98468d00af0302fb35faba6aa2823.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"mtm3rE2hWdEWcs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"cNLzLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"oZaqSiChf9vOw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"vbRBsZ6BlJWL39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"uGc0JRfloHw6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"cv5nb9CJCRIdq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"krF2gl6dgo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QZSKZH4LfsSoL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"k53Yjnsno7IULY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"avT6HrBXp7rD9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ImQzknuMn4pnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"ViUTiTEFQ5EG3xB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"JZ17ixiRkHnDJOk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"zyrb4GV6IYcRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"I8tjD8r2LFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CPQZVYmRF109H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"vuQUeqYNeMmGkGS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"DZ5Lvzre2KQXfsX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"1Z2AMXzt6q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"c7a8EY8oqlwUNb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"EBwWa8Ktme\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"xMlPgaw7px9ozRP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"hPkY0UkKYFn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"emtnjr4RZga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"pY1VbZeozNM22lO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"yuVqDntLzAH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"dw6oRI1z58bgpmT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"GqhvPkCeQiMBfZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IbO230LZXxy9a5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d3bde12350819091c0e8f72e4d75e70978327b344e0861\",\"object\":\"response\",\"created_at\":1758707169,\"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_68d3bde251cc819093b730a87c058cfb0978327b344e0861\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"call_id\":\"call_QhjlX9hhvKCySAMwSMlmTGGP\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wjYM8DNZ8SVOiS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8pqizI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"6jt2AG6ssByiH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"koxSep2ucHZQ02\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"UgNbPPAzaXx5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m8hkREmELvQDU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"pJAOmIM0cm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2Y0gAlqGIr715\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"2wMWoYqHTCsue7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7S5EGLC9T2Msi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"iT9XbhVl7EJsw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"EhvzoumZwu9O2GL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"AR6oKKi7lG7XuwX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"S8ItXIa9cZ0h7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"8n2L59MxHXx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hDSqtEMm5LGGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"m3NrnFKgEPUvpWs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"KKar4dpc4Ya9Mni\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"ARoLTIMjDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"t3xE45gTyJCjgUn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"6fMpgCMaKj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"HHGO1rGonKb23aJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"rmR5gQiN9wT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"VtjphqJ5HtG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"vXUFdBiuMgu55uf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"XMTVgQogqFu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"3gAhf8KyNJDGLBD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"bQjBKaKDxU1DPM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"iNaFMRfsG3vfOW\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]}\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_e761f6071dd9550f02555f17668007d5.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_e761f6071dd9550f02555f17668007d5.json index 8f95742e84..894e0e6687 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_ef6119489ec14cc18d09b7fcbdb2b4ea.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_e761f6071dd9550f02555f17668007d5.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IDnc90bLKvCG8x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GlhkUX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"EK5hjRfmnvja7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"HfdFtgikkrdMpa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tdO7UpIT0aBw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dcpSpEe6OG9Dy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"jFHU9lajwe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"izBPCE9RQckYI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"iqsvRK4Mxh8aR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pVdIxG038TINQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"UnjZ2mtej8vdR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"69Clcg8uf8bhVX9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"mEWY5dd2SYskKHc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FvjDVJA9PLRNU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"TfuVuetRM1i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CmF0QnJ8ptIrd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"JPlnvsWXB2Xtknj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Ctu0u8x9pa2mpE9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"p3tJwx0pEhiQ1V9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"JiTLiP9l8Xi28\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"wutwaYA9sIp6k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"4orJfB0LoGDhIsI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ij0rIcxJ8f1E30\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4Ph5zQeCXbXuB1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68d3bde6ac848195afd3d7600ae71a5302af963c771d9b41\",\"object\":\"response\",\"created_at\":1758707174,\"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_68d3bde72c0881959cffe7ca0e327c3102af963c771d9b41\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"call_id\":\"call_SeA36rI7mfQvTIP0QUb82swN\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":537,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LzpT60ChydIkJm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"gSQmdP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hikgGFA6Lcanb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"hIzEnhkvmYJwaH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"2bTQODMebGQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VSyDI51Jkuouh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"mF6PdY6mK2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9hv3DdNUJjEdY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6O5hkyZeynhs80\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"weVAF5D4marXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Deo5v1q4lClck\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"JmLjZwEu0XWAgz6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"fpZ2BL6RprOobkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"UT2a9UYKIk2qL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ciV9RW04g6C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eD2eUMAs3h4dC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"nVftop0ZHI2yFxK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1nCtR0GpLLpBZTT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"jfXJElfTNLgMexs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"YTjXytjVxfD5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"D7z8pX74VeApQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"omz6nj6B1g77Hnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"pS1IZTCgMHC3BD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Xv9sYmBRDDkNSJ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              APPLES

              \\\"}]}\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":537,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json index 863093c65c..b9961a59e7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_25a7b376cf9a40be2786f79865156598.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"cCVYTqV5A0QZ9w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"9TyxXT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"pXUXSithKguci\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"eyMHo4mNwfocQF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"iFOymMcqV3sF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NowPonwCq1UND\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"b5n3cpAK0b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8rw64Z46HjGMo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"k8glsXmd7TyxNG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3UsyK3oGaLePa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"pBokYsynHrj4k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"aoU9YB2aw14YoR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"KzTkWgx5yItWFha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4Gu6cYnXgma2b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"9A7myDzRTNI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m1lKTQOzKA8lv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"xiSzuzn9ndJzQnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"rpudEqS5oTHfAmw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"PGMQxnBnktUfgV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"QXAJXchCcsY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"PJUOpuHEVDFD5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"4qzRlywvvu5j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"iOkZMZN8sP1N0lD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"9BtthJhtmwsrdc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BLrZhRoUqgbNFB\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bde7d71081979736c113941b89830bad31b9c78d2297\",\"object\":\"response\",\"created_at\":1758707175,\"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_68d3bde857d48197b5910d7ed326d10c0bad31b9c78d2297\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"call_id\":\"call_F9OzfMufnPJWAFIpO8Dvbj3h\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":539,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"BV8G0CKI9FnpY8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"CE4rm1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"yI1EUxenxYJks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"752oXa3mxe9YIZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"qjYqNfQxazRz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zr0tWLLKNAJj8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LoAW6PjiRO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"O20cRWW4jePXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Vzk79WbbGLK0Ij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hiQcEiWAhH0MK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"7ZKM5qGb3QsbQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6ioc5HJt9ABzXy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LqveK4x4gSjXQO9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"7EnlAVUNZ6wIy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"EHvwtpjAzCp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"c3kWcnsvZk2AH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"hQwIEW6muQtEJSz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ESgltTrdB4JaRjR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"6KHmoVVaP3urru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"SPbZVTJry5u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"AXwOQ5TENLuIw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"6m1f8tPPwkF3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"ijnM3vnoK0wNyWd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"nN6fp0CqMn8In2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"LXlSxvoasj8D2P\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              I NEED TO BUY:

              \\\"}]}\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":539,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_88263a5a62758f9c809abbab15d1c4c7.json similarity index 63% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_88263a5a62758f9c809abbab15d1c4c7.json index cd6c3bd531..846fa19198 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_8d43715f4d9ed3bb5a9216bdf6fce70a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_88263a5a62758f9c809abbab15d1c4c7.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Zi0cmdtb21ZYhB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Mw2iX9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"qNWlz2lR1EzXB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"yyY9TTiEJodd5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"MzvRQBkg82CT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"qH7bHvgKngVv2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"kJA2sPWNnc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4ULt139dTE5rh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"jFQU7cCPPxpN7S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NR1wpoQOySGAG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"5J7YpRwh6qOma\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"1DJkYJqIEWXgrOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"fJHrlmwr92r2cxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WQAKWbufsjVa5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"E4LIOLB2jeq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4KYS37OAcxltZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"GmHA8apNByzY30f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"u0CmbLuxau0GYBq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"LWCekwXlQc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Zq6YPoQGHWwFwMC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"OXV8fbRW5vXfUr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"M1SIBdU3vYJb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"SBD4aZF8AiY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"DDVXV8J0Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"V58hT2Bk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"XmAroL0AY1Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"80oANgrbvoeks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"lG5sKkzaT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"BsMEPgInfDGNKh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"2p2JWTpS8kb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"iwgSYVd4jek\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SbxJMARMwyNui\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"EMwRUaS19VeB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"r5QBeVndgWtM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"YZL83CSps6ASs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"8atCaezQjp5Zvz8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"s9nGmchzH03X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"xHUCJSfBuGGJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"52TvfzjMxbaPTXv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"F9K9X3NWhMOkGZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"P5Jx4I2Fc3vU7M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"B9J499eU3aICbN\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68d3bdde4d348195ab55c6a0c522e16503aeaf5a9d865353\",\"object\":\"response\",\"created_at\":1758707166,\"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_68d3bdded2588195818f4a1a1418eb9d03aeaf5a9d865353\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"call_id\":\"call_WjQ0wlp9slYE7fqY1CAOZTj5\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"n0uKm761ELuwAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Nb3Cmn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"TfqyHLL5nmcux\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IF3nJHQe3F0Ngw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"y510XEVW0KlU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LlR0PGGEtZ2iq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"NHfrj9mUkj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WZgMdgjAKHK9u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ZHlbCsDFLO80jn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yY1fbVFVpaxR5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"QK8WYIPleZhtW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zAkR3buewZPBPIY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"aCkXlvbrtphv9jP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9SSzsjVCVr0cd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"E6pPjAOV1ij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XnUcuke4RhEKW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YCm5cQo9mpAyEsL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"es3rb4Z5dBpm2hk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"J3WsViohRm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"sy4BWX9UQygJWRC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"uga6WoPtFDLhR6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"emyVot4CZfcD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HPAhRMM7agc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"HgHHD6TuB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"CoVsOmnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"RI0nVgFvgwm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SL8FOqtiamGIr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"6fJd88VMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"UZOJXqSh3skAKA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oXMawxDAUdw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"C4tOQ4y2vwq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"znalHhWpu35k5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"gyRAiHOmi2ps\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"m4PxrQ0ytN0s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"1IjQtM4medADJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"3sV4FeSfsqEZC8r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"mVyY8y1ulldT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"bxrCOgqxvmxi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"flYZ7DQGveh9xUH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"KrpICgg4WPExQ7W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"rowbCNBx74C3gz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"suPo7Ndj70bAFA\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe!

              \\\"}]}\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_a68854dc4dee1520292cf8b8816d3bf1.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_a68854dc4dee1520292cf8b8816d3bf1.json index e5d35cf047..1e12a16314 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_c5f9c947bbd30bc61b89cc08d041cea5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_a68854dc4dee1520292cf8b8816d3bf1.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"eoP6DZlaXXzfFT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"i4HY0q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9Vt9EhX2DUiSZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"oMYbDGxAwFSbDA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Kyapnlh3eO03\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"b3E53pbE6TD1c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"eR49lRTFnD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"GJRQaSTNo0FHe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"EWePGlLGtRwkwb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"t7Qgz95Eo1xu0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"avGRezg5VsfnN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"5RSaUjjaBhyCyYZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"uPLveZcnbF34Q43\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"op0YAm6tyQLRt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"WqJrHMbHqB8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ppl15tr7HsCdm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YQpucEHA40h4yS5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aoUjAnjPO5JprBZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"RnJh4HT8yvePYqD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"lzSOM6lyHDg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"emPWj1hgIeMpkXa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"kLkYBYaYTkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"V1xW4NetXICIjKZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"iO1KshEqXtjQXx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OJw2ITm2xdhdlm\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdcfba7c8194a0550552bb37ce830baa4088acaaa298\",\"object\":\"response\",\"created_at\":1758707151,\"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_68d3bdd04800819494c0505a90cb0b290baa4088acaaa298\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"call_id\":\"call_FVirSMaYTg09QtmwYww9DhxK\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"iEkemn1316OPGu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"P4ZQ6n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VHJNZYtgLdmbu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"87yefTLR0fdw91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"nSyuKPsn6hpV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"I77AdV05NijRu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"dSWTOWFOoP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"mIQhiX001ajTc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"XOzkTNeUrhsRzi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PdwbFmTGV4z47\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"h5qI0qCpcqaPH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zprLFlUrmgranBl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"rXwA8OaD831IMFo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VoEUEbuD8L3yC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"WgDyb14RIsq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"D0PE5RXY5Ncm5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"2GoRVYwgB6bgZjc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ZhNWr11ucaUSHih\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"QKvaUZ4cJzoN14J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"iHicBCshSyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Ck0WhUbFvBsxuDl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"crdbrhQnckO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"oBXbM3SsGR2vbRH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4ARd2aVZjXahXB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4fk2EFvjmtestl\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hallo, Welt!

              \\\"}]}\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_44bcd73901e9f2eef1a454db1dd3a05d.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_44bcd73901e9f2eef1a454db1dd3a05d.json index a3feb6bcbb..962c9f22a3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_f265b08529a3bb0962b033db42e40f5c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_44bcd73901e9f2eef1a454db1dd3a05d.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"d32U2IK16ie4fV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"lwzkP7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"C36fTn3DVlNP2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"KkNILRaJaOSQ65\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"1ii3ZrZjZ3h4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7lEN7TA2Z4vg3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"1KxedG9qVR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"AsDFCB9S1XVyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"66y0o4BVNjBXdz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zbavezMor9l8Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"o3uiJoEFWjt8j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"DWXQTKN2kpwQViG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hYBpyUx8INr3OJd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"sikJ6vJo0EMvD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"TTyBK5n7mRQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"lyvrUmZIEFifL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"EwMiBtkApftnUnR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"u9dHDe6uIsbbitx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"g731oUDJcL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"p3PC2BaIytP1aDv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"iLSVZkllXGwGTd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"LlkIrqTQQ86J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"t3PeNqO8eNC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"DZxbJAuMQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"LCmjcKN4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"9FK4lwSqEhS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0gABaGH9do4nH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"gIV2IDLw2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"avJ9HOK72wg3z8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xekd98ySTEn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"W7dyVIrNMYx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"igj4Vw0doy9Hg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"L0DayxaJcO0x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"rkxcF24Ckj5m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"LkBuMf0AUEiLP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"7Se2ZTx7fSLIChC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"yDCxud0gDVXF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"IsZczhLNmRGw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"t4wDwxq3IzJ43ad\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"AnOwZowPZVTpMkp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"mOl5545HGMWs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"BDp5GXa3zUXo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"yy0f9xaYErNr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"RPR1cUBZlT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"88qNlG0X1s2Y6WI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"PR0z8bH6re4G7G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"5JnI5TxOYjm7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"qXDHHjGDhs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"CUYeeibX6pVKR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"imrG9VsAuCb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"6ohJjjDh6ofosiO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"11qSW6IWJlt1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"yZxgDTy8yd2Hwig\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"9uWiLyp7CTiPDw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"I56BqzdBZJWj4Ay\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"IKnas7fPfOffJ2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"ZM4biakUcBkkS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"K9pstrVjAgC4vTN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"ajM1BZAv36ITMLE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"JlEaynLwS93Iy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"Wm8fUdyZZFn7sO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"oi5uKuEUPS6HSp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"1SosouHAfQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"aMWGFDxP91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"nYnJUdmkjGJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"zJo2nAKB27MOB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"0PmLfgVDRVuK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"vN0pq0bhDlh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"QuShZjF0tZS1Rp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Biu5OH5Pc1q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"09eorUCv0f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"vyXw8JyNCMnvp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"8k2MGXwzvFjL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"RiVj2vuMmybKuC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"JvyNYaWkdBI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"KcZIYXHMgxw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Gq1hVDyIt0iE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"DWeO1yrsRPRS8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"3s7kfgv9JKnOP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"DgxHa41u0Yvx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ob9RLSc6ms8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"TJcclvQhzP6ED\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"ybaetcA74w9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"5n89ZWM0so2M9QN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"t9B8hqhV0B4Ngz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OoROA23pjOOoJX\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68d3bdd7c9548193ba3986090971a0ff0c43de14e89659f6\",\"object\":\"response\",\"created_at\":1758707159,\"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_68d3bdd841c481939eb3668a1fbc05ae0c43de14e89659f6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_TwtVoOGRCL6mLj0vag42XOgE\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":663,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"5pisvt0VwF0mvr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"7uJZF0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"AqxEWFHqdtf6a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"10IalYfxQadqEF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"J1xUtbzxc7QE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EGCIBcgE2jk8D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"4nVyDtb3LL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1JqY0gK8G0SK6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Y7dlV76LOzTVWR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SQuBlE00fEBH5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"fhhV9hcTJmGmC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"S1SRNFXABb8N8v3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"g5gGqcoFPBu6M5D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Dyrbr9eYedwdr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"56vBrPMQ2yN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ySbxQYRVxwVUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"aKLuwQWiPDFdX1G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"JAVx487aqGyy66B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"kzZRMz1h1L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"IiVHHNmpF69ZnaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"aBoLs7X8O43ua1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"igCCqi317Zdj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HnikedEJhm8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"whNP7H6c3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"DcgfrqeO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"MTruE5UbPQe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"L45K4Xdq8fJsx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"m1Up5L8pp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"h64O4UypkC0yJ5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"jb7F1IeirEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"7qs2uSgMNuH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sZq77doFEWoE9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"jz7hf7WfCV7n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"TPWlJn0actS9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"QEkwk3CRKzBIr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"NN26CPyzcqea3Pl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"9MPNyU8KTv6W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"HZKcMk1qj7fF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"Ez0evKk3CJ9AwMb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"03WcKJLuXUQersJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"3UMfCmBBLcZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"2EG3bPvr2tbM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"BZ25WfGLHcvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"aF4FTnlMWO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"PD0SZJ1ymLi3lp2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"3UX9GLjVGFYUF5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"ybXD1Dkw2gyD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"yK0axdx2YO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"aFfzEe9M25aJZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"1c7L7OBmIKb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"q3TQGQAdG8Gae9W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"EjdRq07bdv1O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"PUgPlUCGcbJhmO7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"EzN541gaq3n10u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"lTqmJG1HrN6aVjH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"4YtqmlxESSVimkf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"Rc4mEtEXjcYDU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"5MtzPBjBeXPTwrz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"9OH2psi9ceX9sO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"CRCR3EtwgzJEK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"1aC58vX9dC2pNW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"jMpvlJ1Yxx7FWW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oZR969F6v8X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"URgqgkge3s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"UefdaXH2oTi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"imZkbzOC7hi9h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"UpLBBX0hILwL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"n7aBX7I8YMd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"QtvjwRlVmD7d4o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Qhj4FopXiZh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"8kNFx3roNo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sWnsKtbK9147m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"1wBzW1EBauJz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"IQM7Tr3IzYEY9r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"83k4u4SJXWd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"Zfetv7JJjir\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Xe1GI4V0RoPM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"idfhMV4x1lgrL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Ze1XVr1pvhluZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"eetdNgHQ7qQ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ZzjTXtIAulR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"26DSfoOBrmMwo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"rAMmrFLLA8s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"bXAms6GInakBuK6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ZKhmE9qaD4GQJN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"s2aOHjevmEaRs6\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":663,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_89aa084ced0d3526355fa9ec0a7a0f38.json similarity index 58% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_89aa084ced0d3526355fa9ec0a7a0f38.json index 82bacad450..c0dbb1fb30 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_1447b6b4a31a37fbbe03816c97c133f1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_89aa084ced0d3526355fa9ec0a7a0f38.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YdKa6lydKpCF1W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"w24hbs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9TqxfwLKeK0Jg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"KwaVQ3nYItbiWN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"dWg5CfqMnfTx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"3JVywBhPY59Qg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"p3zRMYoF8V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"uaNIt8I3ErTXb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ra3IiqpyNyCA56\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Tp7XlyrZ1fITl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"SYesGX28U6K20\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"ZPqv1g4LVHZpFQ0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"3f4W13MG8pjQdVI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2KpzM6KcpN12W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"fDnNxwX3f7t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"E5bEIO4mpv6uB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"VpjTMCclOP4eCmu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"qs4ArpCZapvOYFi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"g2caB0vJkV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"ajV7x75vwsvIfa2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"2DUhPTQQaCeQKg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"rp2VgSDR23\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"2Ii8CxbTMKMkpuX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"lyqujgtO77C7V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"G2YVyiofKTAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"m8i1fj4uqABo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"LFpSOs332E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"MglNiEvK92to5ZG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"XutMr7eAFFVBxw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"w5ZCwNoUzVXO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"13RgCbWTUd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"YnU9gZigiFZmJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"LPZd7kxEVEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"HyroAABFo0P5SMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"yAfDUo90Sq7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"fFEkZI9kuU2i8CS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"SUNdMWuE09Zy2O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"9is7tMQ3KJHb6id\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"FwW3VutIoz9aALg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"tbNFM4SfzJiq5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"pF0YMMiMJ6i5SAW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"g2y9s2u9GCLQDII\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"Maszb095Wn6B8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"5GjovZMwp54VNK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"tJubSnADA6OJod\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"VdRjNlnCKBA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"sCaeQPlv7Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"O7LClAmuRe8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"3KuLfZt17HlB6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"StCRr0ouuNID\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"FdAd1rsvzDL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"2T80tv8eVXTiDf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"LySj6pqk2fQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"ScdbX8cRRH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"nqYN9fPlHlbQT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"7LmUOvJ5sFrc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"vDcLuyanw5YTeY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"gMRmMFxHzxQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"SO1eslyGiR1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"13B1EGGa3an7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"0y1VrJ6xY4XsB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"DlcuVF61NSVA0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"a55jEYm7vzrs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"OE36FRwUl3v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"NwMDH1GQ6Vf30\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"EQo61jYpLQN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"EmpS8ivMI5c70SP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"K9Fv73oCCacyno\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"rj1Qkecn1uGbk7\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68d4c2b926948197b6754847028ca82a09cf279752f7e5f0\",\"object\":\"response\",\"created_at\":1758773945,\"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_68d4c2b9abf881979a5ecf072f2393ce09cf279752f7e5f0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_Aw1FrIFLCiK6yAXWIV6LHp3U\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":679,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"T8Ftwdvjx8vSDx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8O6PFr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"23AoyOE00IIl9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"r5VWrVWXexy79v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"jLBYn9g4pvMh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tFiGh6ZGLKddo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"FRRVEvptPO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FDencZqXQzguz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ZX14hVjvcyAeBG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dZ1f0fIAbUxGM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"iSw6R9fTOV1C2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"yrEC4As9esZQqbN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LdI4oXXII4c18Ol\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hr1hqsrVGeqyq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Z4KpWwnFAcE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WaC2qTaXezBdp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"mKSvw4bwnp5go0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"4Rbs3aRvL6yQ16y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"TezRkphpQc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"dfcEfSULXtrXb48\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"rPlc5j4YS4Semz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"N5A6qIzRcm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Tos14cDXNrkYbSZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"TKlKfCr9qGwx8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"tDpzZOWPHBwO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"B0oZHHbm61Uq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"cu1LQoKMF2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"cZ0vpjuzz3JsmDQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"mPEdtRsiGOyr1H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"2USYOOWuxgNF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"IxclJ2cbbT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"LWzRRBezPGaGv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"dUNLOsLJT2O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"uEfQznk328HBj7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"KJb9uawGKwkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"a9Bl0IeQ0cG6bhu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"ESDgWJZnNkDlHU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"4Y33UL0nlSdWSb4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"S16FXFMNRbPzPOj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"N0BmT6kaW4glz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"jHElqFVpLYP9f1c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"KhvNV7zBDe1peFc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"KPKIkelSZ2GnR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"miwveyMwb51ocP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"dTuauCpvC1sJKs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"C1rn9gxup9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"RT1KH01SlX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"E4duOpOvm7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"GLz7qwUSpcUH5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"rPjyoUtYDcU2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"vpFdyaTHktb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"YV5XKsfV0p1f8e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"kWln6rYlxcP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"GC9BpW9swK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sIXrvZDf9rv1C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"U2aDf5pAFz8p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"rNOQmiCftZmgI7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HOkJijIQPoy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"w8pQ2WQVr1o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"OVsYfLT5aOLz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6Ggjc3KitiDjQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"pY2dgEQt8RDM5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"zP6TTYWJEEZE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"lzoRPh80BbO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"Mvvp9ldBv0l8F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"cHrOPwtgVkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"qC7r9XPKwmChQrO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"yW2RmyheyHHTtp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Srkq7h6BcVeydZ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":679,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3f251996dcb01d2a4adcb6b548554cc5.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3f251996dcb01d2a4adcb6b548554cc5.json index eea5d83bd7..70bfdae1e6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_8607b2c5692d759cd4b56dde8dd2668c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3f251996dcb01d2a4adcb6b548554cc5.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9lU6RI2mIKWZyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"AUbVyN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"BFpCwIcZ0f2SC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xWKZ9cciQmcm2X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"cGMnC1Pc3cmv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WiB0YF0XKSTRU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HsnOpteHju\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rNLBQCxPxLxv6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"lUlIbqTIqa1RUZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"YlwF1B7NNktgh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ybc63xA1urEel\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"tfXfKXTvBytrcku\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"edh8smln6KqL1yy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"E6JdNtwfaF7Bt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"0mDaFrvME7u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Tf1BOweRBd7xF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"U5g2CynL34wrKXD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"eR3Wwa4gjOEBFzt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2Sy9t8FtzD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"VKSlKFNK0bfOLby\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"Ro2yrnVq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"oMxx4y57\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"Dp33AWrbyOGuy7c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"eS4JdPt7Z6WAEh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IJzAV2nePppzCr\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d3bdd4b37481949a69a89ff24be8440cbb51bb5e48d599\",\"object\":\"response\",\"created_at\":1758707156,\"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_68d3bdd5456c819497e1c1026f354a080cbb51bb5e48d599\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"call_id\":\"call_27LUtgPruMtkLyi5nUvDU0Eu\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"CoyWwHR3CHzJSS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5jkEb5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RVPgYiHkLXK5u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YzjmSQ0Aj2rwmq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"eGX2dUHpFh38\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eiTd7gHGohA0X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Id6FPzJsQ1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SQ3Dudh8rLWP1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wkIWpEuLCYHlkB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"vkjWDQ45qToGH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"xv5C3UVE2WWW2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"heX2bmabDSx4LZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"4y1IpoxIVdsgltz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TPuehBf0fbhUI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ovHHEVNtO9A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PiTXENmZZiB5C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"BMtHU71Ky0csRDO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"19PGjuJa9OjXWr5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"SDVHKxq3gM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Fqwp9Jicpjhkuoj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"RPYvVb7d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"Aug02wjf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"hnxyEpeUIIDBKwA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"96IahztYHh8APp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"1aDXc45khIymO1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, updated content

              \\\"}]}\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_61b231ae85994a3eec1c2eaabb2b3e80.json similarity index 54% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_61b231ae85994a3eec1c2eaabb2b3e80.json index 3a6f59ac91..a92155538f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_90697ba401b8db0a68d54ab1a23672f1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_61b231ae85994a3eec1c2eaabb2b3e80.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"cdBf1gx1H0DUA0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"2IHsVO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"9Hlnxupcw3B6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"l47fzF3qT33iMs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"MYzPNyvxQQFg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"CR23byf7uh7vJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"r5oQaF7Us3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"91fgWVR3YE6Cj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ecJE5Livde5E6v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"2NKSpcqUX5T8v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"LIPGwOr1G27lS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"zQUAwB7oY8D1Gs1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"QQVwD8Rv6fBzh4B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"CbM051YwYa6Pb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"K5u9mQimTog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BmQPQcrwVHsvL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"ulvjWXmzxtbbmZd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"aMKq5RH9ZcyxtpV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"1IM5c4e9ch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"7YUB4yFewigxf0V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"BC45voHonFZt8K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"Y0hAMOQ7BXuu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oYSlPTYAzZJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"2tTjcvO9S\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"ggHp6kuP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"qPdGxGeJ0nj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"QpHzwUWF3W49A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"WLmiEMDTW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"bRYX5uBzqs6DJw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"X0KmOBI8RGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"BIBx9WXypPR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"KfUnYp5eUeYtM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"m9OwhuLkpZp6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"68fZlMNX5mBF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"pWEYZNXxLDEYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"ijIeHZggavTGAJX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"YYqIXg5Ds1DD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"2wNe4Mf8f1Xx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"w3UuKVF1JrwX3eQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"GUpVsAhh5Axp1pI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"uKFl9dn2jq7Bsv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"TkNNvyMXQU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"WboA90mq9p67gLB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"zAGvRf0bz1M6N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"JoUoa93kPQSk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"bK3YY3mN2uWG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"LHjnT9W2sT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"z97AwqsS1tK9zKE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"CXKKeEyCaCIb5U\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"qCXTTHnwvWpG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"WRxRSL4WMu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"8AP6tf3o8eFvh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"gwjaTb4lHCw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"XZdHSlibIxjeOfG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"HdaZSKfKcePe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"kOrsfVGCvuYlftB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"mLm29bfXW3veii\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"k0AZJ8e8144ot1a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"9G8z89LZ7C1DAt3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"VGgCQJh6q6eq7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"lchgwlcf9drQRnK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"anbZk8jsWvTujwG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"hb74SJobCQ3tP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"xi871FdQHAbNyO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"7ucHf8hIrAp5mS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"hcorlL03pdN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"yYHarxakz3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"VMOPdDcsMsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"7E6kPnuatpHi9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"2QZMXc7AqZbb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"wf3U5FIaB7F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"3FMdj1bpjLGneh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"cxbr4mBbhBh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"yD4DxEkban\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"q33VXazmgOLxx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"A0P9HrvmJgc7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"PQGcABlLTkaMbl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"KxiVAyO3qTa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"l1twVRkC70n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"XeJcrfa5rt9K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ugorytrDOfEYy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"LcdOuVIu0oIyS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"yB0SkYM7Vu9F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"lhQ4bUtQd1J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"7KSIgvKiviF6y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"REtZjg2kCEr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"DhAtHFKEMsxpogj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"TDdnVS0ol7weUY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"WxvIRTpsgBrYlL\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":100,\"item_id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":101,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":102,\"response\":{\"id\":\"resp_68d3bddfa52481978764fa1429716e02042fbfd4c7000e17\",\"object\":\"response\",\"created_at\":1758707167,\"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_68d3bde0d8b0819791f77b06fe6c9ffb042fbfd4c7000e17\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_XCwPcDTD9Dny8VitXOMFxOlq\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"PR3XlJC7wAHeNp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"R9Qw7p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ptspQidYksMUT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"vHSY1AUsK6cPE0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"phWx6UEwN0Ig\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pMw8nZBlZIsHx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"ha6mPSjdwe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"gnyAVdgmsBlK4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"kZPryB3faN7oqk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BHAxzqivUAXNA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"w7Z9NnZnZQ32J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"9EHfkhBnyo1zbHt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"G86hmqxGBT68eSJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dkwhtW5VXhBHu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"4UosUIljkOh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BVa7kasWnHoZY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"V1ui14QnPGS9cuU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"SiWgHAnggZupPAD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"RF9ZYdCxfc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"9j0Fx5t7WpcsrQa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"n2VFUmSmuHg8O4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"hbwcqduC79Hn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"R7FCI5I6fAq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"IBOkByuW5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"I6TIMIKD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"G9SABNoDz9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"tCOBSBZqoOJYm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"0AeGyZSLp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"CftdoDkwd5Nelr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"9vUTXFangga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"FpK96TLR5KO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Urt5LnThKfQet\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"1i6hkn0S1klL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"5IjBGxJUFBzu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"v4OPFyqQ5t01j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"wjTKJwu9ArDUY1k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"EKLwPvzmuP5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"QCFRxQPG0Xv5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"qrxOVPtWQ0HvrfF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"wkFe4XmTHlP7RDM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"hVfLH1g4Wsz3OG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"bKVTskeMs4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"esYtO44fb67vFPf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"OoKLuMOzrXQIA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"cPmBpYbVTCNS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"pq2DEnnboTaQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"bhuuk1bEok\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"6tNqNuMb1cSw9vj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"DM2t77LjAAJHeM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"4TivKBPQf7bs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"uQXwD8nKAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Csidq6BxrebI3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"iXrYXR2k7hj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"NJ4uTeE0EJmRv1W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"maMm0weCyFa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"6AqRr0qKJJgejtn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"vsrDX7mPl5SdOX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"ABdGlbc5YF7uU2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"8BK4Z73zyKSokAL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"TEgxuVSpZ1RYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"k5CIZzFgZDOrlS3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"fb78IfHUA1CSBTX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"jEDwUcn3MYRTf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"KxwycamsSMQNGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"uTU5w3Tz0uljAf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ZPHoC0g3XQP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"udelzac5pd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"r6rkTh79T1Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"zD2Zss4HtX2uN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"XiOXTEFuCV5h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"G4p4b85Dtga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"TbWkBVULPhoYFH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Hsl95UfuX7K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"SAybd5PpBL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ekMpXKHY6ZQn7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"cpnWyd7bwDws\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"dmz0K504K3Z7NE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"l5z0cnF5qVW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"zhtme8DvI0y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Jx81jgr6Bs2n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"By7MKaO47jKru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"fGoQp6RBZ3990\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"TmhQi2xqdWlC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"x02QJlNxmY3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"7XxN9J5x0BYT5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"VTob0tal9PA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"EPAM3rqQd2kqEYT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"MweRigrxmzTMud\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"ljsoeTaXxefetk\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":100,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":101,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":102,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @Jane Doe! How are you doing? This text is blue!

              \\\"}]}\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_3fd6871badc2f924056864cd76a571c0.json similarity index 53% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_3fd6871badc2f924056864cd76a571c0.json index 118c636e25..e7b89bf8e7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_f9baf6e1f21c2ff975bb8476164dfe3b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_3fd6871badc2f924056864cd76a571c0.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"3yg3eGE0skVagB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"fWUQ01\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"UMVlM9v4LREo8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tiBPU4pF3wBxIU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"mVkQGBZY2qnO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"B62FiqdFuG8eP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"aMOJbng1NU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HcOs6BRob2m3x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"JGk1ea84f4YZjb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xzn4Pq6RFy0Fe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"g5xSpEcsoKnxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"2oHF5JfVGFs8VBX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"Ye8QjZaZgWztiEO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PE2hGpLSuiSmc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Y7YyRbyvN9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yvSBIQt56TX3e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"nLhCc6amwN2nq0E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"o973811Jabg0bI8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"r6GNfocvqYRNGu8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"U3hO6X2Riha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"jq1d7R56zXKHqex\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"rryecWCTMXEBd2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"7CLzL1Sva6pm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ciJ3OJPHJep\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"gNEUViS2i\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"NQlIRfaz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"MwGpJKO8tPk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Axg14rGEGfbpw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"7uLhk5tba\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"UlCYIvb6S3pqXf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"wh1brRJc8dv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"Jxd3fh8wbrJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"kl6pzMuzv1NcQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"ormLYrdqIel3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"kU9gsoz7vSKG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"blUhyitxzyhcC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"tRDNlp8M4UlYFq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"szFHmpvg9QGC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"YjXErWdLOlKB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"YU2xOF7C9Dpz8k0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"5zKcrGLTaXjEp6a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"pjODyq0DfJDCYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"vwADa0l00m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6541w4NTxQtHnj5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"YrniXIQQ9TKR3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"mME8sOiTcvY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"wjJMZOo2U4PP3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"O0Ccp2PqEFhG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"DALVzSPaxa9rwch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"1AbSCTxcQwgn2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"SWUlii9pkFfM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"temrrriNap\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"IuAp8hMTcxmIF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"OEZsr4jW0fF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"uqZHNhWW4Ts0NFI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"vO3182G8eSiY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"wBkR9ytB4PkiV8R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"43IwFBfmZdI7Ns\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"qWtfNlsfveg1703\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"nBHHCKmTRjvo7Rh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"TOfLnFffUGwDK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"HMyoptzNujEa948\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"vxRJGymRh8c27Pa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"2eu3u54b4HUs0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"sKX0wmg0apmfmt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"migMovmpUpSEDY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"CLnABAzYeHn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"67jrWAdY1q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"xyOcpMjRsXK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"RqZpvnetn3ieG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"9mboxwAHHl2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"E2KLeaWipy1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"Q9h6DpCWISeVyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"xoTiMJN9lyP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"WATN0tlEYp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"jVVVRNk29IAQd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"adzrxnC0DwrE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"05nBLFB2wlqGBo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Xy0MukPd6CS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"YSK2IDzFXsX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"6l3wLwm62yD0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"N0K3cdvyCDMAl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"spFl8qQ2KKFFt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"Lo5xWDyqp6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"TxOgeI0Su4s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"j45cLe1Wcjop\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"tO39JGfW0WG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"ctp0QdjoebwXeYb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"aRRopU0CYDmN1L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"OjGL9NHbWBf8mY\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68d3bdd609b081958ea869bfa16b55c40a701522e6f61726\",\"object\":\"response\",\"created_at\":1758707158,\"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_68d3bdd682b08195bba133f5d083775c0a701522e6f61726\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"call_id\":\"call_QydqTXKvGT0rdBTHrbCW929b\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"NYcjouII9jiAIz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GLJVaA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"6PQemgI0CmALf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"j68TyRgDNScn6w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"osKfGHREwFvF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"k3Pn2Hbj60Q8t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"JvyTqsthxz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4cOzTQcWEmURT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"jtaA47rLp9owo6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XSeLQgfYb0fkh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"0nb6W1KE3AHtQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"sWD05ZCEAqzHeB0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1UlWip5hK3MjcVI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2LGsJRBQIiSJw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"X3McAaePoXl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hVoULkXRu3TJz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Qa2bMKkHtmpHelW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"qf1k530Y8FLn5fK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"oJCbXif3WySFWSp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"HUanVRXeL7q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"czhirbRZrxT9hDf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"s4rXaRk18Fwgej\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"oAUhqNVsLuwC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"YQZJjambFZR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"Izfap7ndU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"kc6cNL7v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"G4Cn7uSqhhM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6RPXQvxf5F3zi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"9El0Wxrxm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"z03CoZT34wLwyw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"lgeE5CrLsOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"QXs4Si3PoB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"XNM7xYxiRR9n9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"hadC6TjtSDhf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"fRn9tvDc1lOv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AsucGV5NNlry6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"Y0O5IX1JDCFMtnG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"hYnXuNf9MKDM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"HweEOrCtRZNP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"DSMIxzaNqaWP9dl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"CSoV3B1D3xsqLKZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"kAE3vxGguf8Xy1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"5QHGJX6H7g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"sfi7SSnpkQhcfEd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"3Yzbo08m3j0w0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"WjUUPF1NNC5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"3rmRKgutZ2D63\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"qEURWeWjZRM1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"zqivT7wx42IEyaF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"9MSLvH7ms4PpBf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"aeQMFost10tO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"HTrHRQjkVf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"kHqrPrfJrGUhQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"5dk5CvhrlrF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"avWE11spvUfJX7C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"SGteH1wAKw9C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"GZh3uNCNivE0cOB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"yw29IIBTMPL6m0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"iORZCAfzU8s1iqs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"Yk7cIIfqyci4BWZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"Hos3RlK1siDji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"JjWzEjKmHKxZCFE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"OH4av7gdmhM9DA3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"A0Z0wV9A0qCrp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"CfBaOGVP2NTYUO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"CA83rPjj87CWRJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"sM2hnlpFIPk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"Xw0y9PrsB2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"zooorpN1k7d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"V7IW79Rr6v8oh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"qAAHoDldtHqI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"E4B12HG7Wcb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"TULBh4WmUKYUnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Z1Kr6F5Cowh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"fNA2wNA2f3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"KpEs4opMCot0H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"w9vRkdt8gEtt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"U3zqXfl9BQ2d8m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"fox7huxRspi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"MfmNGb4cIX1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"NilwfBZTFojJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"40JDmzDlw03TD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"6yKHnFhd2tPLD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"VnrFWD892f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"ugx5OK1j4zw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"l0jkK558lOtG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"cp1aFslh6xr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"u5QcB1eoVM3Y42e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"0Ar1GqsQgiEo7Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"H4o1H3PXhBV7I5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!

              \\\"}]}\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_728e83ee8b26541816af7dcf417e127b.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_728e83ee8b26541816af7dcf417e127b.json index 17adb5dfc9..a4821b3ec9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_9b1d3a2188afa487f789dd156b22760d.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_728e83ee8b26541816af7dcf417e127b.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"32eKRNUJP4uPFw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"l7KkeQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"roERfNFZLmHga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"y1SOfi5p2VC6Kl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"aY0w87riQPkU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"KNRmVfc0Tvhdv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"MjblBcWaBC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ROEFEmETY96Fk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"h5MEbHGbpsAIhH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"D6qIIGLzQIE9f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"fr74TirQk8nYp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"o9ElnTTaXtcg7hR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"YJIcRs8fBXUdFaP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Pkwqd5bJmh1WT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zmGz3NhVVYf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VTgDnGJYwnx3J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"lu7KCF9qq9Ep475\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ZNprBJ5nUk7rq2t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"6XPdfGwiHzjaUS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"TFpJntKhlq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"YUagsTo4i0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"G6thjQcvWVeA3wl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"frYmNOgOPp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"AN7sYzC4bscRLnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"D8Sec8oXbJKhK9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"an1bEeVrBgtcNs\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bddce6d08190a0082d0129a1357c055258243d0bc7af\",\"object\":\"response\",\"created_at\":1758707165,\"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_68d3bddd86448190a70e94125d874c0a055258243d0bc7af\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_qGFFwXli9DqvGs06lxtiFJLU\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"seO7gIzUM4Hidk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"659X9Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fUJbS3Hdvm2KJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RXDzyyFuAm3tOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"6TqoHGMFssMH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"vy5c1U2fpTEoy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"eDqljw3aGO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3HqiVRBSmh4tR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"1UK4LyUbnNVdIm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7n9jHuLkHXo2g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"xVAJM9zPRevCj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"veNA1rj1Q5zcdJ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ssjQn0C8h0KY70Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"OcFMi0w5dz2iR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"vd1GhdFN2zb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"gx3IPzvyyF2Ru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"WkxyfjQgbhzgOQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"R850pmWdDDYHgtf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"jb3US2ZNwZNdr2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"LMGQE0ECm9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"5wDakNLM5B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"wD7kaTDmhSHpOnV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"AoR5eorisk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"8KrV7uk2g94Gcf0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"qARWn4JrIGzQAU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Q7YRGaZKUIp9Ad\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_abd0a85b8c45cfa0b4449a382dc81602.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_abd0a85b8c45cfa0b4449a382dc81602.json index 2a0eff9a04..e1644e322a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d14263cec9b6767d63f061c4dbd9b0f6.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_abd0a85b8c45cfa0b4449a382dc81602.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"Kep2zwtie5Yepa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"rfGD2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"8BO0AoZlDhJUP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"yLWFMW4abxhwR6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"9KVJYmcMcR5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"DeryoIE31ZMeP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"xjj7aRmK1I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"5J2GZay2U9UKr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"cmyl19esFxhSkk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"d9Hlkuf5iH2ha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"KyHSNRrXgdgy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"shWygUg2rProHvQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"O6Bg1sVSUPINYDR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"PMTuqP7sOnjf1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"jvvbM0a4WIp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BnrVsWMgkcSaE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"LnlzqjPw1Ye7Nm3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1JUMmgXKK6TjBdg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"7vQAEvpyJ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Zs0IBISvfy5c7qE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"ToAwlJJF7bL09O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"JFFNoOhGTA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"vFCB1fs1zWXABhX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"cRQbWYcqexQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"rWbO8sqeEY5y7A5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"pXnehjAaAnueXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"2h1EEyr1EqXsKc\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d3bddb8c408190ba1c5576e88038b70e5b3c324663a2d7\",\"object\":\"response\",\"created_at\":1758707163,\"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_68d3bddc29508190b0ecb4a2bf5fee3c0e5b3c324663a2d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_lVAfByPQNwzHb2EWgjpVIsMW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":666,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XZuL4JRo6S5uqV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"d2XHzi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"cO6vgCrs7qhsU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2SNLsNnIPaA2nY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"XrJfBQGtwlFZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"DX50X3bCPgJJL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"498yCem4RR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"IQXvIcPttnx39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"FQBqh5gF7cRdwI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"QYogOTMlsI2kb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"YB90eZq7EkdGr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"ghndjKd70lgeFPZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hH6D67gisvWLoSK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8UrLhtI6FnYdO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"uFCXEZmZjIM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LPWpyOZuopHa9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"LsQQFzo9cjFmEIf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"2ONzVB9kLiUqhYn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2C0LSbgqYY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Riv5gtn5u84B5Tm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"WEstWhqDd35hqC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"vMWPzoblZr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"diw61BJrIiYBfR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"TbayLV2dtuZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"94EKr9SWJYcg0ge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"DZU5M08NH274qc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"GEl1cgvxBgQatR\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":666,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_c0b30a449a94314760b815a202ee6f64.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_c0b30a449a94314760b815a202ee6f64.json index f2d653da6c..b07faa9a41 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_3f7a20484d5ce0f53a05fba5810b307f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_c0b30a449a94314760b815a202ee6f64.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"JP3yw5DpXjGCjy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"HV5dnq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"DmXEcVSGU0mY4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"0nkQP7SDuYp9uX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"amYpJh0CBfid\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"0iJyPZcpVjxez\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"T4VTpd5YHL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"nk6o2C4pIOtPa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"tqGEakvrD1MHQI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7pdcycJGCStYB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"rNonqbrM9axew\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"5KUCajAKfXldT2q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"vPVBLaeeNXZwB5w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3z0q74n0IgZ9R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"LBo2e6kX77r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dRDQanKBTE00C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"2jXFJCLNC1Upp5t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"vlDXucSmk73ZRJf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"DAFnOrrsZxy7lPd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"yCI6EmRnY0Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"FqpWS7ivCOFRUHp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"DBS3T6yLBQmJSs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"xlZNIROWk2U1nU\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":30,\"response\":{\"id\":\"resp_68d3bdd0e57881949c42717383401fd004cf3ca4740d9eda\",\"object\":\"response\",\"created_at\":1758707152,\"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_68d3bdd14f4881949d471d432e6d485504cf3ca4740d9eda\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_ZalYSuKwtC7b3f7MTYBxgOq8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":491,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":517},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DfewBwrf7SUUky\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RttDts\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"zqMHxOan4J4Ge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"z64NpcqAV6UkAe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"0YKj0cwoUjFe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5Ju3EdOagA6ZA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"21Ezc1DSsZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Qjlbkag1Fmg55\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"4igSlRefk9NBOE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eMev6ehjLGwQ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Woky0QS7JYtFV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"yXgifm8nbnsDCwm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"cS0PDYpvOKAxI06\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"l7r7Zmmp45gzV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"t94pkNt5wq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VKoN4kC090qY1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"TE39Xt9yFke1nYo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"v6yLOksGuweQUKy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"jZblIffPbwyzSCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"UIMQH9Pjqce\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"I0Ht1p6M3VknMww\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ftPfKn5cyloejG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"t8t1OWjCytXzyp\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":30,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hallo

              \\\"}]}\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":491,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":517},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json similarity index 59% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json index aaa7123639..282b857cb7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_1de6675c8dd76d0d991b35418f577bc0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"

              I need to buy:

              \\\"},{\\\"block\\\":\\\"

              Apples

              \\\"},{\\\"block\\\":\\\"

              Bananas

              \\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"w3EQxWSjJdFvha\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5S1Wyw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VFR3fYK1ZdJ7l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"tDggpZpNsyP0Bn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"IhkcT2I4RZ8f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4ppzQmSLIDgPl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"mg20M2A7Jn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TluxiBjVoafR2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ghVFH7r2FCIRqG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PrHYNRcrD5DwX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"FHMcC5DwgnLKz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"FGCHoEgKszFjwHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"s5Hn5T8betJbWcP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"NNvJf5QWikHjN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"cpFnsBw9v7X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"RlCLBKBhw5KwS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"IiWhxqjrm9QqPBy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ava4m8GsF9ffTX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"PBbrCGVcZWJaDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"g48D2xwM2G6y3C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ODyQeIeCSklijqR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"oYM7MGGbNi488n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"q05pCUN146uy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"8RGgS7sQmV8N6h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"8zBTyDyj2ihn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"2GHy1GH0ibWn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hPEIdIH4t4J9D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"q1Iqw40XxJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ud8lgqIbmJXi8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"G5L0q5h1MhlJog\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pbw3BShRnPKuF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"0CRuu3VKsJJ78\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"ZHB6MFxuXqd1mEY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"OmfGiDXQZdvucse\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rVl3yMhN20GGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"pU029jvh0qh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ArcbV7HqhEFjx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"u9Ct5Dw34zBplGy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"Veg9UHmCd7ImLA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"VPWQqJMaVUuINV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"MRJWmOOGKvyegH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"lTM3o2g5b34b9Dw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"R3Df6gRfahSd7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"F8p4yStMoNY6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"eNcncMIjhkCGUrm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"vdE6fuop0nVmHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"XOSyUJwWD7BSGA\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d3bde3b6248196af61672d872fdac40056336ab8158c58\",\"object\":\"response\",\"created_at\":1758707171,\"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_68d3bde449f48196825f94f686f68a970056336ab8158c58\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"call_id\":\"call_p9fp7aWh43tdhv1sFJ1uudT8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":411,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":467},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"M54aUz6AniEQnm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"PwwkhL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"IhG6y6pUacocE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"a1awzwqpOkRE7Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"GyAKvKXyACTz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GeEluQsYisBhe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"riKariqMxN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dDb2JNtTDtvQ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ToMLlr0yQ1aOWv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HA0x1wOEHaiFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"DkAeEPXpNP2mr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"MUKzmLcpSRTMTEM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hkuowDbtAHjB66a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"wP1fVxxgpWjGz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"a6VYNrDD3jt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TZoFwWgIgcuOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"zG2bvRIIPufN6ZL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"hwZxJzu3ZKzpFC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"kdgBLAuVokSK7Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"bvLjYsuulSCclp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"4GlM0naa2to9Tsw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"hADASku508uJfN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"b5smjHlImiMy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\"\",\"obfuscation\":\"K479BPs645prPj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"ELrd8kZT5NF8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"aBEy7yy94khd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tm4D2egTz9Oho\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"cVQoPY4u0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"kqd6Y3RYqJtIC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"GCP6c8QxS54HsJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"JNev9l3usvFQf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"zNnbLRxMqa7gg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"qo6zaeyNVZto7hQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"W4VhIhkZuxYkSRD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"KQ5tmq6zaFsXc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"sNJxyUrkFVP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"T5zEVNY2FA353\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"8SjF1vYRCFBD8vN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ioclVRVrtHS6mU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"LBBxQXubG8VFkC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"z87iFoacx0dzp8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"5lYKHeT4PaWRYYy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"L0loh1FjinHGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"MO27lTGnqmHd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"EAc964BO3JgPtLR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"55xBC3rVIABrdq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BtGSrfnD8AdGcL\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
              • Apples
              \\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"
              • Bananas
              \\\"}]}\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":411,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":467},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_a560a1761f87da8f3bdb7b42357ba4ec.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_a560a1761f87da8f3bdb7b42357ba4ec.json index 03aa501450..50db40897d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_dd621803f2b7173fbc649dc1033c09d4.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_a560a1761f87da8f3bdb7b42357ba4ec.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"a6oEisxFS5JKVs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"r1Cgh6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"toyuskCFIf6YO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"knTxGq5bq3vYbR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Bd75kJtNFB3H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SRy65zMfmvkPW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"N4qCxNPhrx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"butW6XuUHpfwu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"qQmIhRUQgkFUTz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"36uto4A12sdg8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"a3YQM7ljanFAM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"oM3MP5wzT9mj4Wm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"o7j8gP4gKPkPI6R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"oGK3q68BGOB2H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"crzyWrjSE6G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VVufKaUNRLWA4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"QvphG4ONOKCvSWk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"HSHHONW5E64P2GX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"tIooPkgV4m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"pBC6gCkA3WgA7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"UtXd7bZddap0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"RaqiSNbxAF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"jH8qsyRRwwc6Kag\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"R6vcrG8hCz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"WMg5xV4CqLZRaL0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Q6hwQQSBw1Z3b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"909uditRpk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"13DhgtPF8O342\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"zmnulk0bdix8heo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"WvFLuGKTaO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"CONHPkb1Nc6Eikg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"3trShZFR63kocs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"MjDjAAvmluOrJ0\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":38,\"item_id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4c205d1c48190a1691502dcdb6edd0d9aba198db43cdf\",\"object\":\"response\",\"created_at\":1758773765,\"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_68d4c20679708190bf1e2c57a96e6f740d9aba198db43cdf\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_AZeGrFIia2iiPjaeesO5panv\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":708},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RN5vuDxOjrrljC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4WU8ra\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"0WBj0lRkUpi2D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RO8O5gEkpVTdvI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"IgUgXeMwtxPI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LM2Nz3e0JPI0O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"hHARf7sR8E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"g9d6DvQP6NVRI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"12nvpHHESg1Ahd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7USNRssANDsGl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Myqrx01WjS5d5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"3gOv1NNIhcwzjcI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pKp8QgeBgcqGsi5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"M9BXcCRbbhu4M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ExDNzvqjNoQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ejHrBWIUmlFhb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Kge8lYsjysiQrFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"f5MCDv8rA3UQyX5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"74rLyRuBWI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"J8MWM4WSyv23u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"yqKsKzXK2FnH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"LsFNJDTRkP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"cVwqXo24JWoOHnz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"C55MP7VCds\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"9YDhBOD35QZc9dq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Voiexa65u8fTk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"rFAz2j4kjI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"C6WrKUJZVvdGU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"UHkYV6VaOHdnDoS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"Zca2eJwOM1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"5rs7wp9ZLWv5rRN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"2PnlFlSSIkaCmX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bDKacg5HJCgKl1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":708},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_d959d9e97f6cf99760b26b7d17c11244.json similarity index 52% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_d959d9e97f6cf99760b26b7d17c11244.json index cc20b41eb1..5c95bd03be 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_ab0a01fa6be0c754feda7d55862b94a0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_d959d9e97f6cf99760b26b7d17c11244.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"S9gsDHljgQVaw6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"hifwRV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"B9blyqJKnfiI6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DHJ2C5J0yC4ahw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"YOvgHLuBaZVb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GsRA4OyxHjIAK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"b7r8QzVlng\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"HdX7OeY8LQ3p7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"hGPumKlQfdXaVc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"fHeeQuVAFFbrq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"4cHnkaGo2hQGu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zxXzoS98fLJg0l0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1uZ05PG2hxbP14B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"0wMn1ei4eoPgr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"o5vwormgvOi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HzK3Y6QyxJ8tI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"cfdqZ2zhCKU7Q9P\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Ma7Pw1V2czcEplF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"qFwjTW81QY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"XcvdiIrDAYu3X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"PZWBpXG4Xg2V\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"gfbZlBIEMa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"TiDJ7gwJs9uAmzK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"f7BkNJbyOV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"4jJACskTzpmZqF7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"0qgkEzsPZB7ZV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"Hello\",\"obfuscation\":\"lc493SOd6tV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"KKUpBsiujj7YTB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"GdezCDPFqQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"D30IINd4ZkXtwMD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"32VEb7MRajjFWT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"YuD62tu7CY1PZo\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":37,\"item_id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":38,\"output_index\":0,\"item\":{\"id\":\"fc_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":39,\"response\":{\"id\":\"resp_68d4c202d034819591f95364dd8276cd0ba28760fe6e0310\",\"object\":\"response\",\"created_at\":1758773762,\"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_68d4c20437fc8195addd0eef537735a00ba28760fe6e0310\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_pedg1VbxRiKO7a83nVrRWst1\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":696},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"zpu4Q5d1JKlBbF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kq08Z7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ESfiso7v9BTn7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"j8wsiTeQXJydZK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"EcQMk5iN4pX0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"6xH8rV36PTNlM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"RjteRUL1Wn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TWb78oSxABMUD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"KXjrnkya523WjO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jflf9r74FfuP4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tDbdYPMdy8bDH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"SnjqDnqg1naMNpE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"K5JApbPvEYcpooc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ap5pf4cTI7yHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"D2MK198njbd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EA5Qd280Je1CC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"KkdTIpuIMwquG9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iYBSX3IdoEdiSQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"Uhj6HLoL3M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"4Z4FN6RvVzmJm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"TsadHxp5pbDV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"W4NqDZAjJ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\":right\",\"obfuscation\":\"30MhqKAcp4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"oaP3wiDQgihq2U1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"9qJXuyK70IWsb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"Hello\",\"obfuscation\":\"j3ZfM10D8cz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"XgCKj52TQHAAc2p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"wyVNsAIk3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"JB0oHNpbwZbiWL2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jxnS3oMJVkpfaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bMS4xa7uikU8NU\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":695},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_649d6a7338cc6b674c4b4c38184c1037.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_649d6a7338cc6b674c4b4c38184c1037.json index a27d6c1cd6..22974b65c7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0a946efda0df9d65d49dfdd31a7ac9d0.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_649d6a7338cc6b674c4b4c38184c1037.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"zQz6iGebOhroRO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Z42Z0G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"rz762ARi2xlyv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"QFWFfDWbKLgcGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"G2fnIqHFeG0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"paWUok9xueQeT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"1PRhCMcEy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6TMZzKMS9gulX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"i3IEM1czHkmYeJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"lcsYLpDFmReov\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ZOa2XkXV4sEiv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"fBlOXhO5jB4HANv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"6JKCFCaigDjhbWH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"vYQLN2xl6oY0h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"QebVKbWG6CW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5F3egQyaUgzU5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"1dlmZx79v8vDAY7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"KFCEEtMUMHmmHno\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"7IZn6EBRtwWQoCa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"cef4wUtV2tWMP3E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"F7SW9hswHg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"5hkt0qM6BEeso\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"bcqAHYNIBQ1PGd9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"kCsyyBzVa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"FgquKiD3q5adGkL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"qqKCiNUjGL4N6r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Jd0CqwODCHPTV9\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d3bdd334908194b6b67973f13b34eb089cd97d055e1f15\",\"object\":\"response\",\"created_at\":1758707155,\"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_68d3bdd3a27c8194bf871d1367ceaf2c089cd97d055e1f15\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_4CGJ4g84OeoN68vHAT9d8Q8Z\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":703},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9V6oLRi2GHZafd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"qqBOXD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"8ZBESW9TVIbsd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LFCNjvMOTzCo71\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"F2fz5Lp7KaVG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"xQSl7m0Vowlzb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"AOyi2y1Y3Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"xY2BAPSf2McxE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"qlPzuzAXODEH2Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xh1sfG9mPc4sk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tt35ENDso5zKi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"lt8YPz0Tk0evYUU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pxafmfNPsY9csai\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QQqEB8lQKo83t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ZtbK17P1zz6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4xhohonYrtkWD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"OE6ZyocPGUL8uP3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"8AtoPo1mY4EAsG8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"9NLqUtrgC7iCBHi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"R5BQ9Tev3stfOMI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"1OlLmByPO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"YKzpsLGU8KY8C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"gg5HObchZYxfsBS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"sMrgbel1Un\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"P87AngxKxdaDOkW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"SVrV6bPxpSoOyW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"XDML6E9t7eLTe2\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              What's up, world!

              \\\"}]}\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":703},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9cbb96117eed2b41fee6c0802fe00bb2.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9cbb96117eed2b41fee6c0802fe00bb2.json index 5281ae5d3f..aa40986e1e 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_3cd44dcefabfe1768eaf05804aaf9ba8.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_9cbb96117eed2b41fee6c0802fe00bb2.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "https://localhost:3000/ai/proxy?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fresponses", + "url": "https://api.openai.com/v1/responses", "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
              • item1
              ` is valid, but `
              • item1
              • item2
              ` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with
              ) to specify the language.\\n        This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

              Hello, @John Doe! How are you doing? This text is blue!

              \\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

              Hello, world! Bold text. Link.

              \\\"}]\"},{\"role\":\"system\",\"content\":\"First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}", "headers": [], "cookies": [] @@ -9,7 +9,7 @@ "response": { "status": 200, "statusText": "", - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2F0iy4WkYsay3N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"KT8DGn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"WdHo5mUzyzxOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"lNDM89u5jAiuki\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"z7FXoRpKEw7b\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Ota8xR5iSULBJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"qWxMGjjyZ4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"UnGQcskchj9g6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"dTCyI9OCnryD61\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XO6yP94bIiSFl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"J2AEnuHjN3dms\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"NZVLO9gkrDuCJXL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"DwJ7oSh57RtMTsQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"DoSLQBw8aDePC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"UEsvwGzw8Ca\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"iRxPowQFE2kMx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"oIzknJxXJiiST7m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"kcqxLFNadZ5jwvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6aghmhJdV46ZSp3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"CZMBgOjuvz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"7BWkcssYM3YVO9a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"fXPCLPyewW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"qKFyFZOk2KY7R98\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"3sI0kNiQFdVNx7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"9YDiyAX27y9JFG\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d3bdd1e2288193afc862714cc9415b0e68c8fc0042d9a1\",\"object\":\"response\",\"created_at\":1758707153,\"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_68d3bdd26bb481939b26ff58f72b83870e68c8fc0042d9a1\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_KuILXXdpKuo6UH7igxbLl6LX\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"kn2NWv1ciLlzQv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kHt3u7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"m3ycoalLL6bcG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"6ZRuYZciSD0A13\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tB45w1SBIqTZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"i5y53TsXp5KGm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HLJsdnlWLg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JMFj8fJDtz2Bc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Dg2Oj99EPR62cL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"msRJwOOF7sDgm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ixgN1rkqnTPy3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"99qVvIj92lugzV6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"byU3atRGPDUeLga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6vGwxYaz3AgFt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"folySlFbUVt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nytaYBgebUtSn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"OquUmfPF5RrgCXI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"HfpSGcGU0ztBLD8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"5nNuU1w8xJGF3iO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"8cAzPDPPB8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"a3rq0JKVCmNXxww\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"QK37mu7WcT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"YTsFzqStvParv9l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4kJ6HEkkNxRSN6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"5A9ZxW0DjSRtJs\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

              Hello, world!

              \\\"}]}\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n", "headers": [] } } \ No newline at end of file diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts index c4c93c41df..41c58a8093 100644 --- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts +++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts @@ -1,30 +1,19 @@ import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest"; -import { createOpenAI } from "@ai-sdk/openai"; import { BlockNoteEditor } from "@blocknote/core"; import { HttpResponse, http } from "msw"; import { setupServer } from "msw/node"; -import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js"; import { Chat } from "@ai-sdk/react"; import { UIMessage } from "ai"; import { llmFormats } from "../../../index.js"; import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; +import { testAIModels } from "../../../testUtil/testAIModels.js"; import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js"; import { buildAIRequest, executeAIRequest } from "../../aiRequest/execute.js"; -// Create client and models outside of test suites so they can be shared -const client = createBlockNoteAIClient({ - baseURL: "https://localhost:3000/ai/proxy", - apiKey: "PLACEHOLDER", -}); - -const openai = createOpenAI({ - ...client.getProviderSettings("openai"), -})("gpt-4o-2024-08-06"); - // Separate test suite for error handling with its own server -// TODO +// skipping because it throws a (false) unhandled promise rejection in vitest describe.skip("Error handling", () => { // Create a separate server for error tests with custom handlers const errorServer = setupServer(); @@ -81,7 +70,7 @@ describe.skip("Error handling", () => { const chat = new Chat({ sendAutomaticallyWhen: () => false, transport: new ClientSideTransport({ - model: openai, + model: testAIModels.openai, stream, _additionalOptions: { maxRetries: 0, diff --git a/packages/xl-ai/src/blocknoteAIClient/client.ts b/packages/xl-ai/src/blocknoteAIClient/client.ts index 2ddeceb3c2..307bbeba8b 100644 --- a/packages/xl-ai/src/blocknoteAIClient/client.ts +++ b/packages/xl-ai/src/blocknoteAIClient/client.ts @@ -1,69 +1,19 @@ -/** - * Fetch function to proxy requests to the @blocknote/xl-ai-server AI server. - */ -const fetchViaBlockNoteAIServer = - (baseURL: string, provider: string) => +export const fetchViaProxy = + (getUrl: (url: string) => string) => async (input: string | URL | Request, init?: RequestInit) => { const request = new Request(input, init); - // console.log("fetchViaBlockNoteAIServer", baseURL, provider, request); - const newRequest = new Request( - `${baseURL}?provider=${encodeURIComponent( - provider, - )}&url=${encodeURIComponent(request.url)}`, - { - headers: request.headers, - // if we just pass request.body, it's a readablestream which is not visible in chrome inspector, - // so use init?.body instead if it's available to make debugging easier - body: init?.body || request.body, - method: request.method, - duplex: "half", - } as any, - ); + // console.log("fetchViaProxy", baseURL, provider, request); + const url = getUrl(request.url); + const newRequest = new Request(url, { + headers: request.headers, + // if we just pass request.body, it's a readablestream which is not visible in chrome inspector, + // so use init?.body instead if it's available to make debugging easier + body: init?.body || request.body, + method: request.method, + duplex: "half", + } as any); const resp = await fetch(newRequest); return resp; }; - -/** - * Create a client to connect to the @blocknote/xl-ai-server AI server. - * The BlockNote AI server is a proxy for AI model providers. It allows you to connect to - * AI SDKs without exposing your model provider's API keys on the client. - * - * @param config - settings to connect to the @blocknote/xl-ai-server AI server - * @returns a client to connect to the @blocknote/xl-ai-server AI server. - * Use the `getProviderSettings` method to get the provider settings for the AI SDKs, - * this will configure the AI SDK model to connect via the @blocknote/xl-ai-server AI server. - */ -export function createBlockNoteAIClient(config: { - /** - * baseURL of the @blocknote/xl-ai-server AI server - */ - baseURL: string; - /** - * API key for the @blocknote/xl-ai-server AI server - */ - apiKey: string; -}) { - return { - /** - * Get settings for AI SDK providers. Pass the returned objects when creating the AI SDK provider, e.g.: - * - * createOpenAI({ - * ...client.getProviderSettings("openai"), - * })("gpt-4o-2024-08-06", {}); - * - * Explanation: we override the `fetch` and `apiKey` parameters of the AI SDK provider to instead - * use the BlockNote AI server to proxy requests to the provider. - * - * Note: the `apiKey` is the API key for the @blocknote/xl-ai-server AI server, not the model provider. - * The correct API key for the model provider will be added by the BlockNote AI server. - */ - getProviderSettings: (provider: "openai" | "groq" | string) => { - return { - apiKey: config.apiKey, - fetch: fetchViaBlockNoteAIServer(config.baseURL, provider), - }; - }, - }; -} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 6dd00db1b7..bb2f7638c2 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -174,35 +174,6 @@ export class ClientSideTransport return ret.toUIMessageStream(); } - /** - * // https://github.com/vercel/ai/issues/8380 - * - * Calls an LLM with StreamTools, using the `generateText` of the AI SDK. - * - * This is the streaming version. - */ - // protected async generateText[]>( - // messages: UIMessage[], - // streamTools: T, - // ) { - - // throw new Error("Not implemented"); - // // const { model, _additionalOptions, maxRetries } = this.opts; - - // // const ret = await generateText({ - // // model, - // // messages: convertToModelMessages(messages), - // // maxRetries, - // // tools: { - // // operations: streamToolsAsTool(streamTools), - // // }, - // // // extra options for streamObject - // // ...((_additionalOptions ?? {}) as any), - // // }); - - // // return createUIMessageStream(ret.response.messages); - // } - async sendMessages({ messages, body, diff --git a/packages/xl-ai/src/testUtil/testAIModels.ts b/packages/xl-ai/src/testUtil/testAIModels.ts index 0f4a241157..3a37e78eda 100644 --- a/packages/xl-ai/src/testUtil/testAIModels.ts +++ b/packages/xl-ai/src/testUtil/testAIModels.ts @@ -3,33 +3,29 @@ import { createGroq } from "@ai-sdk/groq"; import { createOpenAI } from "@ai-sdk/openai"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { LanguageModel } from "ai"; -import { createBlockNoteAIClient } from "../blocknoteAIClient/client.js"; - -// Create client and models outside of test suites so they can be shared -const client = createBlockNoteAIClient({ - baseURL: "https://localhost:3000/ai/proxy", - apiKey: "PLACEHOLDER", -}); const groq = createGroq({ - ...client.getProviderSettings("groq"), + apiKey: process.env.GROQ_API_KEY, })("llama-3.3-70b-versatile"); const openai = createOpenAI({ - ...client.getProviderSettings("openai"), + apiKey: process.env.OPENAI_API_KEY, })("gpt-4o-2024-08-06"); const anthropic = createAnthropic({ - ...client.getProviderSettings("anthropic"), + apiKey: process.env.ANTHROPIC_API_KEY, })("claude-3-7-sonnet-latest"); const albert = createOpenAICompatible({ name: "albert-etalab", baseURL: "https://albert.api.etalab.gouv.fr/v1", - ...client.getProviderSettings("albert-etalab"), + apiKey: process.env.ALBERT_API_KEY, })("albert-etalab.chat/albert-large"); -export const testAIModels: Record> = { +export const testAIModels: Record< + "groq" | "openai" | "albert" | "anthropic", + Exclude +> = { groq, openai, albert, diff --git a/packages/xl-ai/vite.config.ts b/packages/xl-ai/vite.config.ts index c6a773ce41..47ac41a2f9 100644 --- a/packages/xl-ai/vite.config.ts +++ b/packages/xl-ai/vite.config.ts @@ -1,7 +1,7 @@ import react from "@vitejs/plugin-react"; import * as path from "path"; import { webpackStats } from "rollup-plugin-webpack-stats"; -import { defineConfig } from "vite"; +import { defineConfig, loadEnv } from "vite"; import pkg from "./package.json"; // import eslintPlugin from "vite-plugin-eslint"; @@ -10,6 +10,8 @@ export default defineConfig((conf) => ({ test: { environment: "jsdom", setupFiles: ["./vitestSetup.ts"], + // https://vitest.dev/guide/features.html#environment-variables + env: loadEnv(conf.mode, __dirname, ""), }, plugins: [react(), webpackStats()], // used so that vitest resolves the core package from the sources instead of the built version diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb2f1367f1..384b1a0536 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3408,7 +3408,7 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.44.0) - examples/09-ai/06-server-execution: + examples/09-ai/06-client-transport: dependencies: '@blocknote/ariakit': specifier: latest @@ -3457,7 +3457,7 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.44.0) - examples/09-ai/06-server-promptbuilder: + examples/09-ai/07-server-promptbuilder: dependencies: '@blocknote/ariakit': specifier: latest @@ -4366,9 +4366,24 @@ importers: packages/xl-ai-server: dependencies: + '@ai-sdk/anthropic': + specifier: ^2.0.9 + version: 2.0.9(zod@3.25.76) + '@ai-sdk/google': + specifier: ^2.0.11 + version: 2.0.11(zod@3.25.76) + '@ai-sdk/groq': + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) + '@ai-sdk/mistral': + specifier: ^2.0.12 + version: 2.0.12(zod@3.25.76) '@ai-sdk/openai': specifier: ^2.0.23 version: 2.0.23(zod@3.25.76) + '@ai-sdk/openai-compatible': + specifier: ^1.0.13 + version: 1.0.13(zod@3.25.76) '@blocknote/xl-ai': specifier: latest version: link:../xl-ai From e87bd7bb027428753ed37d87d1bd2e075d3219d3 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 25 Sep 2025 10:49:00 +0200 Subject: [PATCH 58/68] update examples --- docs/package.json | 2 +- examples/09-ai/01-minimal/package.json | 3 +- examples/09-ai/02-playground/package.json | 8 +- .../03-custom-ai-menu-items/package.json | 4 +- .../09-ai/04-with-collaboration/package.json | 3 +- .../09-ai/05-manual-execution/package.json | 3 +- .../.bnexample.json | 0 .../09-ai/06-client-side-transport/README.md | 5 + .../index.html | 2 +- .../main.tsx | 4 +- .../package.json | 5 +- .../src/App.tsx | 9 + .../src/getEnv.ts | 0 .../tsconfig.json | 0 .../vite.config.ts | 0 examples/09-ai/06-client-transport/README.md | 3 - .../07-server-promptbuilder/package.json | 2 +- .../clientside/ClientSideTransport.ts | 5 +- playground/package.json | 5 - playground/src/examples.gen.tsx | 3068 +++++++++-------- pnpm-lock.yaml | 38 +- 21 files changed, 1601 insertions(+), 1568 deletions(-) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/.bnexample.json (100%) create mode 100644 examples/09-ai/06-client-side-transport/README.md rename examples/09-ai/{06-client-transport => 06-client-side-transport}/index.html (84%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/main.tsx (80%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/package.json (89%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/src/App.tsx (87%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/src/getEnv.ts (100%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/tsconfig.json (100%) rename examples/09-ai/{06-client-transport => 06-client-side-transport}/vite.config.ts (100%) delete mode 100644 examples/09-ai/06-client-transport/README.md diff --git a/docs/package.json b/docs/package.json index 25d79e9303..aab7f80479 100644 --- a/docs/package.json +++ b/docs/package.json @@ -140,4 +140,4 @@ "y-partykit": "^0.0.33", "yjs": "^13.6.27" } -} +} \ No newline at end of file diff --git a/examples/09-ai/01-minimal/package.json b/examples/09-ai/01-minimal/package.json index 8f951984d5..1beaf1274c 100644 --- a/examples/09-ai/01-minimal/package.json +++ b/examples/09-ai/01-minimal/package.json @@ -20,7 +20,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "zustand": "^5.0.3" }, "devDependencies": { @@ -29,4 +28,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/02-playground/package.json b/examples/09-ai/02-playground/package.json index 6cd5289c5d..bcfec7d280 100644 --- a/examples/09-ai/02-playground/package.json +++ b/examples/09-ai/02-playground/package.json @@ -20,12 +20,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/google": "^2.0.11", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/openai-compatible": "^1.0.13", - "@ai-sdk/groq": "^2.0.16", - "@ai-sdk/anthropic": "^2.0.9", - "@ai-sdk/mistral": "^2.0.12", "zustand": "^5.0.3" }, "devDependencies": { @@ -34,4 +28,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/03-custom-ai-menu-items/package.json b/examples/09-ai/03-custom-ai-menu-items/package.json index 4b019cccb0..91dd099341 100644 --- a/examples/09-ai/03-custom-ai-menu-items/package.json +++ b/examples/09-ai/03-custom-ai-menu-items/package.json @@ -20,8 +20,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/groq": "^2.0.16", "react-icons": "^5.2.1", "zustand": "^5.0.3" }, @@ -31,4 +29,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/04-with-collaboration/package.json b/examples/09-ai/04-with-collaboration/package.json index dc42ae499f..cb3a9156a6 100644 --- a/examples/09-ai/04-with-collaboration/package.json +++ b/examples/09-ai/04-with-collaboration/package.json @@ -20,7 +20,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" @@ -31,4 +30,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/05-manual-execution/package.json b/examples/09-ai/05-manual-execution/package.json index f9fa6621e6..d3607b6a13 100644 --- a/examples/09-ai/05-manual-execution/package.json +++ b/examples/09-ai/05-manual-execution/package.json @@ -20,7 +20,6 @@ "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", - "@ai-sdk/groq": "^2.0.16", "y-partykit": "^0.0.25", "yjs": "^13.6.27", "zustand": "^5.0.3" @@ -31,4 +30,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/06-client-transport/.bnexample.json b/examples/09-ai/06-client-side-transport/.bnexample.json similarity index 100% rename from examples/09-ai/06-client-transport/.bnexample.json rename to examples/09-ai/06-client-side-transport/.bnexample.json diff --git a/examples/09-ai/06-client-side-transport/README.md b/examples/09-ai/06-client-side-transport/README.md new file mode 100644 index 0000000000..d4b4cc76c0 --- /dev/null +++ b/examples/09-ai/06-client-side-transport/README.md @@ -0,0 +1,5 @@ +# AI Integration with ClientSideTransport + +The standard setup is to have BlockNote AI call your server, which then calls an LLM of your choice. In this example, we show how you can use the `ClientSideTransport` to make calls directly to your LLM provider. + +To hide API keys of our LLM provider, we do still route calls through a proxy server using `fetchViaProxy` (this is optional). diff --git a/examples/09-ai/06-client-transport/index.html b/examples/09-ai/06-client-side-transport/index.html similarity index 84% rename from examples/09-ai/06-client-transport/index.html rename to examples/09-ai/06-client-side-transport/index.html index c2a78b33de..0502452522 100644 --- a/examples/09-ai/06-client-transport/index.html +++ b/examples/09-ai/06-client-side-transport/index.html @@ -2,7 +2,7 @@ - AI Integration with server LLM execution + AI Integration with ClientSideTransport diff --git a/examples/09-ai/06-client-transport/main.tsx b/examples/09-ai/06-client-side-transport/main.tsx similarity index 80% rename from examples/09-ai/06-client-transport/main.tsx rename to examples/09-ai/06-client-side-transport/main.tsx index 661ad4636b..677c7f7eed 100644 --- a/examples/09-ai/06-client-transport/main.tsx +++ b/examples/09-ai/06-client-side-transport/main.tsx @@ -1,11 +1,11 @@ // AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY import React from "react"; import { createRoot } from "react-dom/client"; -import App from "./src/App.js"; +import App from "./src/App.jsx"; const root = createRoot(document.getElementById("root")!); root.render( - , + ); diff --git a/examples/09-ai/06-client-transport/package.json b/examples/09-ai/06-client-side-transport/package.json similarity index 89% rename from examples/09-ai/06-client-transport/package.json rename to examples/09-ai/06-client-side-transport/package.json index 9aaea55300..27a703fa8c 100644 --- a/examples/09-ai/06-client-transport/package.json +++ b/examples/09-ai/06-client-side-transport/package.json @@ -1,5 +1,5 @@ { - "name": "@blocknote/example-ai-server-execution", + "name": "@blocknote/example-ai-client-side-transport", "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", "private": true, "version": "0.12.4", @@ -17,6 +17,7 @@ "@blocknote/shadcn": "latest", "react": "^19.1.0", "react-dom": "^19.1.0", + "@ai-sdk/groq": "^2.0.16", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", "ai": "^5.0.45", @@ -28,4 +29,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/examples/09-ai/06-client-transport/src/App.tsx b/examples/09-ai/06-client-side-transport/src/App.tsx similarity index 87% rename from examples/09-ai/06-client-transport/src/App.tsx rename to examples/09-ai/06-client-side-transport/src/App.tsx index 841725ba5f..b21efdadc6 100644 --- a/examples/09-ai/06-client-transport/src/App.tsx +++ b/examples/09-ai/06-client-side-transport/src/App.tsx @@ -27,10 +27,16 @@ import { getEnv } from "./getEnv"; const BASE_URL = getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai"; +// We define the model directly in our app using the Vercel AI SDK const model = createGroq({ + // We supply a custom fetch function so that requests are routed through our proxy server + // (see `packages/xl-ai-server/src/routes/proxy.ts`) + // this is needed to hide the API key of our LLM provider from the client, + // and to prevent CORS issues fetch: fetchViaProxy( (url) => `${BASE_URL}/proxy?provider=groq&url=${encodeURIComponent(url)}`, ), + apiKey: "fake-api-key", // the API key is not used as it's actually added in the proxy server })("llama-3.3-70b-versatile"); export default function App() { @@ -43,6 +49,9 @@ export default function App() { // Register the AI extension extensions: [ createAIExtension({ + // The ClientSideTransport is used so the client makes calls directly to `streamText` + // (whereas normally in the Vercel AI SDK, the client makes calls to your server, which then calls these methods) + // (see https://github.com/vercel/ai/issues/5140 for background info) transport: new ClientSideTransport({ model, }), diff --git a/examples/09-ai/06-client-transport/src/getEnv.ts b/examples/09-ai/06-client-side-transport/src/getEnv.ts similarity index 100% rename from examples/09-ai/06-client-transport/src/getEnv.ts rename to examples/09-ai/06-client-side-transport/src/getEnv.ts diff --git a/examples/09-ai/06-client-transport/tsconfig.json b/examples/09-ai/06-client-side-transport/tsconfig.json similarity index 100% rename from examples/09-ai/06-client-transport/tsconfig.json rename to examples/09-ai/06-client-side-transport/tsconfig.json diff --git a/examples/09-ai/06-client-transport/vite.config.ts b/examples/09-ai/06-client-side-transport/vite.config.ts similarity index 100% rename from examples/09-ai/06-client-transport/vite.config.ts rename to examples/09-ai/06-client-side-transport/vite.config.ts diff --git a/examples/09-ai/06-client-transport/README.md b/examples/09-ai/06-client-transport/README.md deleted file mode 100644 index 7d89392e8e..0000000000 --- a/examples/09-ai/06-client-transport/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AI Integration with ClientTransport - -This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor diff --git a/examples/09-ai/07-server-promptbuilder/package.json b/examples/09-ai/07-server-promptbuilder/package.json index d8f34bcf7c..bcadd7f1f4 100644 --- a/examples/09-ai/07-server-promptbuilder/package.json +++ b/examples/09-ai/07-server-promptbuilder/package.json @@ -28,4 +28,4 @@ "@vitejs/plugin-react": "^4.3.1", "vite": "^5.3.4" } -} +} \ No newline at end of file diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index bb2f7638c2..83f5c60b9b 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -181,17 +181,18 @@ export class ClientSideTransport }: Parameters["sendMessages"]>[0]): Promise< ReadableStream > { + const stream = this.opts.stream ?? true; const streamTools = (body as any).streamTools; if (this.opts.objectGeneration) { - if (this.opts.stream) { + if (stream) { return this.streamObject(messages, streamTools); } else { return this.generateObject(messages, streamTools); } } - if (this.opts.stream) { + if (stream) { // this can be used to simulate initial network errors // if (Math.random() < 0.5) { // throw new Error("fake network error"); diff --git a/playground/package.json b/playground/package.json index 6f32e757b1..4cd912b0f0 100644 --- a/playground/package.json +++ b/playground/package.json @@ -11,12 +11,7 @@ "clean": "rimraf dist" }, "dependencies": { - "@ai-sdk/anthropic": "^2.0.9", - "@ai-sdk/google": "^2.0.11", "@ai-sdk/groq": "^2.0.16", - "@ai-sdk/mistral": "^2.0.12", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/openai-compatible": "^1.0.13", "@aws-sdk/client-s3": "^3.609.0", "@aws-sdk/s3-request-presigner": "^3.609.0", "@blocknote/ariakit": "workspace:^", diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 7860cf9f16..7f4c4c3344 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1,586 +1,613 @@ // generated by dev-scripts/examples/gen.ts -export const examples = { - basic: { - pathFromRoot: "examples/01-basic", - slug: "basic", - projects: [ - { - projectSlug: "minimal", - fullSlug: "basic/minimal", - pathFromRoot: "examples/01-basic/01-minimal", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic"], - }, - title: "Basic Setup", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example shows the minimal code required to set up a BlockNote editor in React.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "block-objects", - fullSlug: "basic/block-objects", - pathFromRoot: "examples/01-basic/02-block-objects", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic", "Blocks", "Inline Content"], - }, - title: "Displaying Document JSON", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "In this example, the document's JSON representation is displayed below the editor.\n\n**Try it out:** Try typing in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Document Structure](/docs/foundations/document-structure)\n- [Getting the Document](/docs/reference/editor/manipulating-content)", - }, - { - projectSlug: "multi-column", - fullSlug: "basic/multi-column", - pathFromRoot: "examples/01-basic/03-multi-column", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic", "Blocks"], - dependencies: { - "@blocknote/xl-multi-column": "latest", + export const examples = { + "basic": { + "pathFromRoot": "examples/01-basic", + "slug": "basic", + "projects": [ + { + "projectSlug": "minimal", + "fullSlug": "basic/minimal", + "pathFromRoot": "examples/01-basic/01-minimal", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic" + ] + }, + "title": "Basic Setup", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example shows the minimal code required to set up a BlockNote editor in React.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "block-objects", + "fullSlug": "basic/block-objects", + "pathFromRoot": "examples/01-basic/02-block-objects", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic", + "Blocks", + "Inline Content" + ] + }, + "title": "Displaying Document JSON", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "In this example, the document's JSON representation is displayed below the editor.\n\n**Try it out:** Try typing in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Document Structure](/docs/foundations/document-structure)\n- [Getting the Document](/docs/reference/editor/manipulating-content)" + }, + { + "projectSlug": "multi-column", + "fullSlug": "basic/multi-column", + "pathFromRoot": "examples/01-basic/03-multi-column", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic", + "Blocks" + ], + "dependencies": { + "@blocknote/xl-multi-column": "latest" } as any, - pro: true, - }, - title: "Multi-Column Blocks", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example showcases multi-column blocks, allowing you to stack blocks next to each other. These come as part of the `@blocknote/xl-multi-column` package.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)", - }, - { - projectSlug: "default-blocks", - fullSlug: "basic/default-blocks", - pathFromRoot: "examples/01-basic/04-default-blocks", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic", "Blocks", "Inline Content"], - }, - title: "Default Schema Showcase", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example showcases each block and inline content type in BlockNote's default schema.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)\n- [Default Schema](/docs/foundations/schemas)", - }, - { - projectSlug: "removing-default-blocks", - fullSlug: "basic/removing-default-blocks", - pathFromRoot: "examples/01-basic/05-removing-default-blocks", - config: { - playground: true, - docs: true, - author: "hunxjunedo", - tags: ["Basic", "removing", "blocks"], - }, - title: "Removing Default Blocks from Schema", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example shows how to change the default schema and disable the Audio and Image blocks. To do this, we pass in a custom schema based on the built-in, default schema, with two specific blocks removed.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schemas](/docs/features/custom-schemas)\n- [Default Schema](/docs/foundations/schemas)", - }, - { - projectSlug: "block-manipulation", - fullSlug: "basic/block-manipulation", - pathFromRoot: "examples/01-basic/06-block-manipulation", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Blocks"], - }, - title: "Manipulating Blocks", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example shows 4 buttons to manipulate the first block using the `insertBlocks`, `updateBlock`, `removeBlocks` and `replaceBlocks` methods.\n\n**Relevant Docs:**\n\n- [Block Manipulation](/docs/reference/editor/manipulating-content)", - }, - { - projectSlug: "selection-blocks", - fullSlug: "basic/selection-blocks", - pathFromRoot: "examples/01-basic/07-selection-blocks", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Blocks"], - }, - title: "Displaying Selected Blocks", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "In this example, the JSON representation of blocks spanned by the user's selection, is displayed below the editor.\n\n**Try it out:** Select different blocks in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Cursor Selections](/docs/reference/editor/cursor-selections)", - }, - { - projectSlug: "ariakit", - fullSlug: "basic/ariakit", - pathFromRoot: "examples/01-basic/08-ariakit", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic"], - }, - title: "Use with Ariakit", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example shows how you can use BlockNote with Ariakit (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Ariakit Docs](/docs/getting-started/ariakit)\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "shadcn", - fullSlug: "basic/shadcn", - pathFromRoot: "examples/01-basic/09-shadcn", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic"], - }, - title: "Use with ShadCN", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example shows how you can use BlockNote with ShadCN (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Getting Started with ShadCN](/docs/getting-started/shadcn)", - }, - { - projectSlug: "localization", - fullSlug: "basic/localization", - pathFromRoot: "examples/01-basic/10-localization", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic"], - }, - title: "Localization (i18n)", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "In this example, we pass in a custom dictionary to change the interface of the editor to use Dutch (NL) strings.\n\nYou can also provide your own dictionary to customize the strings used in the editor, or submit a Pull Request to add support for your language of your choice.\n\n**Relevant Docs:**\n\n- [Localization](/docs/features/localization)", - }, - { - projectSlug: "custom-placeholder", - fullSlug: "basic/custom-placeholder", - pathFromRoot: "examples/01-basic/11-custom-placeholder", - config: { - playground: true, - docs: true, - author: "ezhil56x", - tags: ["Basic"], - }, - title: "Change placeholder text", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "In this example, we show how to change the placeholders:\n\n- For an empty document, we show a placeholder `Start typing..` (by default, this is not set)\n- the default placeholder in this editor shows `Custom default placeholder` instead of the default (`Enter text or type '/' for commands`)\n- for Headings, the placeholder shows `Custom heading placeholder` instead of the default (`Heading`). Try adding a Heading to see the change\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Localization (i18n)](/examples/basic/localization)", - }, - { - projectSlug: "multi-editor", - fullSlug: "basic/multi-editor", - pathFromRoot: "examples/01-basic/12-multi-editor", - config: { - playground: true, - docs: true, - author: "areknawo", - tags: ["Basic"], - }, - title: "Multi-Editor Setup", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "This example showcases use of multiple editors in a single page - you can even drag blocks between them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "custom-paste-handler", - fullSlug: "basic/custom-paste-handler", - pathFromRoot: "examples/01-basic/13-custom-paste-handler", - config: { - playground: true, - docs: true, - author: "nperez0111", - tags: ["Basic"], - }, - title: "Custom Paste Handler", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: - "In this example, we change the default paste handler to append some text to the pasted content when the content is plain text.\n\n**Try it out:** Use the buttons to copy some content to the clipboard and paste it in the editor to trigger our custom paste handler.\n\n**Relevant Docs:**\n\n- [Paste Handling](/docs/reference/editor/paste-handling)", - }, - { - projectSlug: "testing", - fullSlug: "basic/testing", - pathFromRoot: "examples/01-basic/testing", - config: { - playground: true, - docs: false, - }, - title: "Test Editor", - group: { - pathFromRoot: "examples/01-basic", - slug: "basic", - }, - readme: "This example is meant for use in end-to-end tests.", - }, - ], + "pro": true + }, + "title": "Multi-Column Blocks", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example showcases multi-column blocks, allowing you to stack blocks next to each other. These come as part of the `@blocknote/xl-multi-column` package.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)" + }, + { + "projectSlug": "default-blocks", + "fullSlug": "basic/default-blocks", + "pathFromRoot": "examples/01-basic/04-default-blocks", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic", + "Blocks", + "Inline Content" + ] + }, + "title": "Default Schema Showcase", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example showcases each block and inline content type in BlockNote's default schema.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Document Structure](/docs/foundations/document-structure)\n- [Default Schema](/docs/foundations/schemas)" + }, + { + "projectSlug": "removing-default-blocks", + "fullSlug": "basic/removing-default-blocks", + "pathFromRoot": "examples/01-basic/05-removing-default-blocks", + "config": { + "playground": true, + "docs": true, + "author": "hunxjunedo", + "tags": [ + "Basic", + "removing", + "blocks" + ] + }, + "title": "Removing Default Blocks from Schema", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example shows how to change the default schema and disable the Audio and Image blocks. To do this, we pass in a custom schema based on the built-in, default schema, with two specific blocks removed.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schemas](/docs/features/custom-schemas)\n- [Default Schema](/docs/foundations/schemas)" + }, + { + "projectSlug": "block-manipulation", + "fullSlug": "basic/block-manipulation", + "pathFromRoot": "examples/01-basic/06-block-manipulation", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Blocks" + ] + }, + "title": "Manipulating Blocks", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example shows 4 buttons to manipulate the first block using the `insertBlocks`, `updateBlock`, `removeBlocks` and `replaceBlocks` methods.\n\n**Relevant Docs:**\n\n- [Block Manipulation](/docs/reference/editor/manipulating-content)" + }, + { + "projectSlug": "selection-blocks", + "fullSlug": "basic/selection-blocks", + "pathFromRoot": "examples/01-basic/07-selection-blocks", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Blocks" + ] + }, + "title": "Displaying Selected Blocks", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "In this example, the JSON representation of blocks spanned by the user's selection, is displayed below the editor.\n\n**Try it out:** Select different blocks in the editor and see the JSON update!\n\n**Relevant Docs:**\n\n- [Cursor Selections](/docs/reference/editor/cursor-selections)" + }, + { + "projectSlug": "ariakit", + "fullSlug": "basic/ariakit", + "pathFromRoot": "examples/01-basic/08-ariakit", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic" + ] + }, + "title": "Use with Ariakit", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example shows how you can use BlockNote with Ariakit (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Ariakit Docs](/docs/getting-started/ariakit)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "shadcn", + "fullSlug": "basic/shadcn", + "pathFromRoot": "examples/01-basic/09-shadcn", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic" + ] + }, + "title": "Use with ShadCN", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example shows how you can use BlockNote with ShadCN (instead of Mantine).\n\n**Relevant Docs:**\n\n- [Getting Started with ShadCN](/docs/getting-started/shadcn)" + }, + { + "projectSlug": "localization", + "fullSlug": "basic/localization", + "pathFromRoot": "examples/01-basic/10-localization", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic" + ] + }, + "title": "Localization (i18n)", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "In this example, we pass in a custom dictionary to change the interface of the editor to use Dutch (NL) strings.\n\nYou can also provide your own dictionary to customize the strings used in the editor, or submit a Pull Request to add support for your language of your choice.\n\n**Relevant Docs:**\n\n- [Localization](/docs/features/localization)" + }, + { + "projectSlug": "custom-placeholder", + "fullSlug": "basic/custom-placeholder", + "pathFromRoot": "examples/01-basic/11-custom-placeholder", + "config": { + "playground": true, + "docs": true, + "author": "ezhil56x", + "tags": [ + "Basic" + ] + }, + "title": "Change placeholder text", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "In this example, we show how to change the placeholders:\n\n- For an empty document, we show a placeholder `Start typing..` (by default, this is not set)\n- the default placeholder in this editor shows `Custom default placeholder` instead of the default (`Enter text or type '/' for commands`)\n- for Headings, the placeholder shows `Custom heading placeholder` instead of the default (`Heading`). Try adding a Heading to see the change\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Localization (i18n)](/examples/basic/localization)" + }, + { + "projectSlug": "multi-editor", + "fullSlug": "basic/multi-editor", + "pathFromRoot": "examples/01-basic/12-multi-editor", + "config": { + "playground": true, + "docs": true, + "author": "areknawo", + "tags": [ + "Basic" + ] + }, + "title": "Multi-Editor Setup", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example showcases use of multiple editors in a single page - you can even drag blocks between them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "custom-paste-handler", + "fullSlug": "basic/custom-paste-handler", + "pathFromRoot": "examples/01-basic/13-custom-paste-handler", + "config": { + "playground": true, + "docs": true, + "author": "nperez0111", + "tags": [ + "Basic" + ] + }, + "title": "Custom Paste Handler", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "In this example, we change the default paste handler to append some text to the pasted content when the content is plain text.\n\n**Try it out:** Use the buttons to copy some content to the clipboard and paste it in the editor to trigger our custom paste handler.\n\n**Relevant Docs:**\n\n- [Paste Handling](/docs/reference/editor/paste-handling)" + }, + { + "projectSlug": "testing", + "fullSlug": "basic/testing", + "pathFromRoot": "examples/01-basic/testing", + "config": { + "playground": true, + "docs": false + }, + "title": "Test Editor", + "group": { + "pathFromRoot": "examples/01-basic", + "slug": "basic" + }, + "readme": "This example is meant for use in end-to-end tests." + } + ] }, - backend: { - pathFromRoot: "examples/02-backend", - slug: "backend", - projects: [ - { - projectSlug: "file-uploading", - fullSlug: "backend/file-uploading", - pathFromRoot: "examples/02-backend/01-file-uploading", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Intermediate", "Saving/Loading"], - }, - title: "Upload Files", - group: { - pathFromRoot: "examples/02-backend", - slug: "backend", - }, - readme: - 'This example allows users to upload files and use them in the editor. The files are uploaded to [/TMP/Files](https://tmpfiles.org/), and can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the "Add Image" button and see there\'s now an "Upload" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)', - }, - { - projectSlug: "saving-loading", - fullSlug: "backend/saving-loading", - pathFromRoot: "examples/02-backend/02-saving-loading", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Intermediate", "Blocks", "Saving/Loading"], - }, - title: "Saving & Loading", - group: { - pathFromRoot: "examples/02-backend", - slug: "backend", - }, - readme: - "This example shows how to save the editor contents to local storage whenever a change is made, and load the saved contents when the editor is created.\n\nYou can replace the `saveToStorage` and `loadFromStorage` functions with calls to your backend or database.\n\n**Try it out:** Try typing in the editor and reloading the page!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Getting the Document](/docs/foundations/manipulating-content#reading-blocks)", - }, - { - projectSlug: "s3", - fullSlug: "backend/s3", - pathFromRoot: "examples/02-backend/03-s3", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Intermediate", "Saving/Loading"], - dependencies: { + "backend": { + "pathFromRoot": "examples/02-backend", + "slug": "backend", + "projects": [ + { + "projectSlug": "file-uploading", + "fullSlug": "backend/file-uploading", + "pathFromRoot": "examples/02-backend/01-file-uploading", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Intermediate", + "Saving/Loading" + ] + }, + "title": "Upload Files", + "group": { + "pathFromRoot": "examples/02-backend", + "slug": "backend" + }, + "readme": "This example allows users to upload files and use them in the editor. The files are uploaded to [/TMP/Files](https://tmpfiles.org/), and can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the \"Add Image\" button and see there's now an \"Upload\" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)" + }, + { + "projectSlug": "saving-loading", + "fullSlug": "backend/saving-loading", + "pathFromRoot": "examples/02-backend/02-saving-loading", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Intermediate", + "Blocks", + "Saving/Loading" + ] + }, + "title": "Saving & Loading", + "group": { + "pathFromRoot": "examples/02-backend", + "slug": "backend" + }, + "readme": "This example shows how to save the editor contents to local storage whenever a change is made, and load the saved contents when the editor is created.\n\nYou can replace the `saveToStorage` and `loadFromStorage` functions with calls to your backend or database.\n\n**Try it out:** Try typing in the editor and reloading the page!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Getting the Document](/docs/foundations/manipulating-content#reading-blocks)" + }, + { + "projectSlug": "s3", + "fullSlug": "backend/s3", + "pathFromRoot": "examples/02-backend/03-s3", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Intermediate", + "Saving/Loading" + ], + "dependencies": { "@aws-sdk/client-s3": "^3.609.0", - "@aws-sdk/s3-request-presigner": "^3.609.0", - } as any, - pro: true, - }, - title: "Upload Files to AWS S3", - group: { - pathFromRoot: "examples/02-backend", - slug: "backend", - }, - readme: - 'This example allows users to upload files to an AWS S3 bucket and use them in the editor. The files can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the "Add Image" button and see there\'s now an "Upload" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)', - }, - { - projectSlug: "rendering-static-documents", - fullSlug: "backend/rendering-static-documents", - pathFromRoot: "examples/02-backend/04-rendering-static-documents", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["server"], - dependencies: { - "@blocknote/server-util": "latest", + "@aws-sdk/s3-request-presigner": "^3.609.0" } as any, + "pro": true }, - title: "Rendering static documents", - group: { - pathFromRoot: "examples/02-backend", - slug: "backend", + "title": "Upload Files to AWS S3", + "group": { + "pathFromRoot": "examples/02-backend", + "slug": "backend" }, - readme: - "This example shows how you can use HTML exported using the `blocksToFullHTML` and render it as a static document (a view-only document, without the editor). You can use this for example if you use BlockNote to edit blog posts in a CMS, but want to display non-editable static, published pages to end-users.\n\n**Relevant Docs:**\n\n- [Server-side processing](/docs/features/server-processing)", + "readme": "This example allows users to upload files to an AWS S3 bucket and use them in the editor. The files can be used for File, Image, Video, and Audio blocks.\n\n**Try it out:** Click the \"Add Image\" button and see there's now an \"Upload\" tab in the toolbar!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [File Block](/docs/features/blocks/embeds#file)" }, - ], + { + "projectSlug": "rendering-static-documents", + "fullSlug": "backend/rendering-static-documents", + "pathFromRoot": "examples/02-backend/04-rendering-static-documents", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "server" + ], + "dependencies": { + "@blocknote/server-util": "latest" + } as any + }, + "title": "Rendering static documents", + "group": { + "pathFromRoot": "examples/02-backend", + "slug": "backend" + }, + "readme": "This example shows how you can use HTML exported using the `blocksToFullHTML` and render it as a static document (a view-only document, without the editor). You can use this for example if you use BlockNote to edit blog posts in a CMS, but want to display non-editable static, published pages to end-users.\n\n**Relevant Docs:**\n\n- [Server-side processing](/docs/features/server-processing)" + } + ] }, "ui-components": { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - projects: [ - { - projectSlug: "formatting-toolbar-buttons", - fullSlug: "ui-components/formatting-toolbar-buttons", - pathFromRoot: "examples/03-ui-components/02-formatting-toolbar-buttons", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components", + "projects": [ + { + "projectSlug": "formatting-toolbar-buttons", + "fullSlug": "ui-components/formatting-toolbar-buttons", + "pathFromRoot": "examples/03-ui-components/02-formatting-toolbar-buttons", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Inline Content", "UI Components", - "Formatting Toolbar", - ], + "Formatting Toolbar" + ] }, - title: "Adding Formatting Toolbar Buttons", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Adding Formatting Toolbar Buttons", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - "In this example, we add a blue text/background color and code style button to the Formatting Toolbar. We also make sure it only shows up when some text is selected.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click one of the new buttons!\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)", + "readme": "In this example, we add a blue text/background color and code style button to the Formatting Toolbar. We also make sure it only shows up when some text is selected.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click one of the new buttons!\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "formatting-toolbar-block-type-items", - fullSlug: "ui-components/formatting-toolbar-block-type-items", - pathFromRoot: - "examples/03-ui-components/03-formatting-toolbar-block-type-items", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "formatting-toolbar-block-type-items", + "fullSlug": "ui-components/formatting-toolbar-block-type-items", + "pathFromRoot": "examples/03-ui-components/03-formatting-toolbar-block-type-items", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Blocks", "UI Components", "Formatting Toolbar", - "Custom Schemas", + "Custom Schemas" ], - dependencies: { + "dependencies": { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1", - } as any, - }, - title: "Adding Block Type Select Items", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - }, - readme: - 'In this example, we add an item to the Block Type Select, so that it works for a custom alert block we create.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click "Alert" in the Block Type Select to change the selected block!\n\n**Relevant Docs:**\n\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Block Types](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', - }, - { - projectSlug: "side-menu-buttons", - fullSlug: "ui-components/side-menu-buttons", - pathFromRoot: "examples/03-ui-components/04-side-menu-buttons", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Intermediate", "Blocks", "UI Components", "Block Side Menu"], - dependencies: { - "react-icons": "^5.2.1", - } as any, + "react-icons": "^5.2.1" + } as any }, - title: "Adding Block Side Menu Buttons", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - }, - readme: - "In this example, we replace the button to add a block in the Block Side Menu, with a button to remove the hovered block.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click the new button!\n\n**Relevant Docs:**\n\n- [Changing the Block Side Menu](/docs/react/components/side-menu)\n- [Removing Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "side-menu-drag-handle-items", - fullSlug: "ui-components/side-menu-drag-handle-items", - pathFromRoot: - "examples/03-ui-components/05-side-menu-drag-handle-items", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Intermediate", "Blocks", "UI Components", "Block Side Menu"], - dependencies: { - "react-icons": "^5.2.1", - } as any, + "title": "Adding Block Type Select Items", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - title: "Adding Drag Handle Menu Items", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - }, - readme: - 'In this example, we add an item to the Drag Handle Menu, which resets the hovered block to a paragraph.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click "Reset Type" in the Drag Handle Menu to reset the selected block!\n\n**Relevant Docs:**\n\n- [Changing Drag Handle Menu Items](/docs/react/components/side-menu)\n- [Updating Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we add an item to the Block Type Select, so that it works for a custom alert block we create.\n\n**Try it out:** Select some text to open the Formatting Toolbar, and click \"Alert\" in the Block Type Select to change the selected block!\n\n**Relevant Docs:**\n\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Block Types](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "suggestion-menus-slash-menu-items", - fullSlug: "ui-components/suggestion-menus-slash-menu-items", - pathFromRoot: - "examples/03-ui-components/06-suggestion-menus-slash-menu-items", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "projectSlug": "side-menu-buttons", + "fullSlug": "ui-components/side-menu-buttons", + "pathFromRoot": "examples/03-ui-components/04-side-menu-buttons", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Intermediate", + "Blocks", + "UI Components", + "Block Side Menu" + ], + "dependencies": { + "react-icons": "^5.2.1" + } as any + }, + "title": "Adding Block Side Menu Buttons", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" + }, + "readme": "In this example, we replace the button to add a block in the Block Side Menu, with a button to remove the hovered block.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click the new button!\n\n**Relevant Docs:**\n\n- [Changing the Block Side Menu](/docs/react/components/side-menu)\n- [Removing Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "side-menu-drag-handle-items", + "fullSlug": "ui-components/side-menu-drag-handle-items", + "pathFromRoot": "examples/03-ui-components/05-side-menu-drag-handle-items", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Intermediate", + "Blocks", + "UI Components", + "Block Side Menu" + ], + "dependencies": { + "react-icons": "^5.2.1" + } as any + }, + "title": "Adding Drag Handle Menu Items", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" + }, + "readme": "In this example, we add an item to the Drag Handle Menu, which resets the hovered block to a paragraph.\n\n**Try it out:** Hover a block to open the Block Side Menu, and click \"Reset Type\" in the Drag Handle Menu to reset the selected block!\n\n**Relevant Docs:**\n\n- [Changing Drag Handle Menu Items](/docs/react/components/side-menu)\n- [Updating Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "suggestion-menus-slash-menu-items", + "fullSlug": "ui-components/suggestion-menus-slash-menu-items", + "pathFromRoot": "examples/03-ui-components/06-suggestion-menus-slash-menu-items", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "Blocks", "UI Components", "Suggestion Menus", - "Slash Menu", + "Slash Menu" ], - dependencies: { - "react-icons": "^5.2.1", - } as any, - }, - title: "Adding Slash Menu Items", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - }, - readme: - 'In this example, we add an item to the Slash Menu, which adds a new block below with a bold "Hello World" string.\n\n**Try it out:** Press the "/" key to open the Slash Menu and select the new item!\n\n**Relevant Docs:**\n\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Getting Text Cursor Position](/docs/reference/editor/cursor-selections)\n- [Inserting New Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)', - }, - { - projectSlug: "suggestion-menus-slash-menu-component", - fullSlug: "ui-components/suggestion-menus-slash-menu-component", - pathFromRoot: - "examples/03-ui-components/07-suggestion-menus-slash-menu-component", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "dependencies": { + "react-icons": "^5.2.1" + } as any + }, + "title": "Adding Slash Menu Items", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" + }, + "readme": "In this example, we add an item to the Slash Menu, which adds a new block below with a bold \"Hello World\" string.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and select the new item!\n\n**Relevant Docs:**\n\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Getting Text Cursor Position](/docs/reference/editor/cursor-selections)\n- [Inserting New Blocks](/docs/reference/editor/manipulating-content)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "suggestion-menus-slash-menu-component", + "fullSlug": "ui-components/suggestion-menus-slash-menu-component", + "pathFromRoot": "examples/03-ui-components/07-suggestion-menus-slash-menu-component", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "UI Components", "Suggestion Menus", "Slash Menu", - "Appearance & Styling", - ], + "Appearance & Styling" + ] }, - title: "Replacing Slash Menu Component", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Replacing Slash Menu Component", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'In this example, we replace the default Slash Menu component with a basic custom one.\n\n**Try it out:** Press the "/" key to see the new Slash Menu!\n\n**Relevant Docs:**\n\n- [Replacing the Slash Menu Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we replace the default Slash Menu component with a basic custom one.\n\n**Try it out:** Press the \"/\" key to see the new Slash Menu!\n\n**Relevant Docs:**\n\n- [Replacing the Slash Menu Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "suggestion-menus-emoji-picker-columns", - fullSlug: "ui-components/suggestion-menus-emoji-picker-columns", - pathFromRoot: - "examples/03-ui-components/08-suggestion-menus-emoji-picker-columns", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "projectSlug": "suggestion-menus-emoji-picker-columns", + "fullSlug": "ui-components/suggestion-menus-emoji-picker-columns", + "pathFromRoot": "examples/03-ui-components/08-suggestion-menus-emoji-picker-columns", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "Blocks", "UI Components", "Suggestion Menus", - "Emoji Picker", - ], + "Emoji Picker" + ] }, - title: "Changing Emoji Picker Columns", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Changing Emoji Picker Columns", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'In this example, we change the Emoji Picker to display 5 columns instead of 10.\n\n**Try it out:** Press the ":" key to open the Emoji Picker!\n\n**Relevant Docs:**\n\n- [Changing Emoji Picker Columns](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we change the Emoji Picker to display 5 columns instead of 10.\n\n**Try it out:** Press the \":\" key to open the Emoji Picker!\n\n**Relevant Docs:**\n\n- [Changing Emoji Picker Columns](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "suggestion-menus-emoji-picker-component", - fullSlug: "ui-components/suggestion-menus-emoji-picker-component", - pathFromRoot: - "examples/03-ui-components/09-suggestion-menus-emoji-picker-component", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "projectSlug": "suggestion-menus-emoji-picker-component", + "fullSlug": "ui-components/suggestion-menus-emoji-picker-component", + "pathFromRoot": "examples/03-ui-components/09-suggestion-menus-emoji-picker-component", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "UI Components", "Suggestion Menus", "Emoji Picker", - "Appearance & Styling", - ], + "Appearance & Styling" + ] }, - title: "Replacing Emoji Picker Component", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Replacing Emoji Picker Component", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'In this example, we replace the default Emoji Picker component with a basic custom one.\n\n**Try it out:** Press the ":" key to see the new Emoji Picker!\n\n**Relevant Docs:**\n\n- [Replacing the Emoji Picker Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we replace the default Emoji Picker component with a basic custom one.\n\n**Try it out:** Press the \":\" key to see the new Emoji Picker!\n\n**Relevant Docs:**\n\n- [Replacing the Emoji Picker Component](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "suggestion-menus-grid-mentions", - fullSlug: "ui-components/suggestion-menus-grid-mentions", - pathFromRoot: - "examples/03-ui-components/10-suggestion-menus-grid-mentions", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "projectSlug": "suggestion-menus-grid-mentions", + "fullSlug": "ui-components/suggestion-menus-grid-mentions", + "pathFromRoot": "examples/03-ui-components/10-suggestion-menus-grid-mentions", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "Inline Content", "Custom Schemas", - "Suggestion Menus", - ], + "Suggestion Menus" + ] }, - title: "Grid Mentions Menu", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Grid Mentions Menu", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the "@" character. This Suggestion Menu is displayed as a grid of 2 columns, where each item is the first letter of the person\'s name.\n\n**Try it out:** Press the "@" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the \"@\" character. This Suggestion Menu is displayed as a grid of 2 columns, where each item is the first letter of the person's name.\n\n**Try it out:** Press the \"@\" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "uppy-file-panel", - fullSlug: "ui-components/uppy-file-panel", - pathFromRoot: "examples/03-ui-components/11-uppy-file-panel", - config: { - playground: true, - docs: true, - author: "ezhil56x", - tags: ["Intermediate", "Files"], - dependencies: { + "projectSlug": "uppy-file-panel", + "fullSlug": "ui-components/uppy-file-panel", + "pathFromRoot": "examples/03-ui-components/11-uppy-file-panel", + "config": { + "playground": true, + "docs": true, + "author": "ezhil56x", + "tags": [ + "Intermediate", + "Files" + ], + "dependencies": { "@uppy/core": "^3.13.1", "@uppy/dashboard": "^3.9.1", "@uppy/drag-drop": "^3.1.1", @@ -592,50 +619,48 @@ export const examples = { "@uppy/status-bar": "^3.1.1", "@uppy/webcam": "^3.4.2", "@uppy/xhr-upload": "^3.4.0", - "react-icons": "^5.2.1", + "react-icons": "^5.2.1" } as any, - pro: true, + "pro": true }, - title: "Uppy File Panel", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Uppy File Panel", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'This example allows users to upload files using [Uppy](https://uppy.io/) by replacing the default File Panel with an Uppy Dashboard.\n\nUppy is highly extensible and has an extensive ecosystem of plugins. For example, you can:\n\n- Record audio, screen or webcam\n- Import files from Box / Dropbox / Facebook / Google Drive / Google Photos / Instagram / OneDrive / Zoom\n- Select files from Unsplash\n- Show an image editor (crop, rotate, etc)\n\nIn this example, we\'ve enabled the Webcam, ScreenCapture and Image Editor plugins.\n\n**Try it out:** Click the "Add Image" button and you can either drop files or click "browse files" to upload them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Image](/docs/foundations/schemas)', + "readme": "This example allows users to upload files using [Uppy](https://uppy.io/) by replacing the default File Panel with an Uppy Dashboard.\n\nUppy is highly extensible and has an extensive ecosystem of plugins. For example, you can:\n\n- Record audio, screen or webcam\n- Import files from Box / Dropbox / Facebook / Google Drive / Google Photos / Instagram / OneDrive / Zoom\n- Select files from Unsplash\n- Show an image editor (crop, rotate, etc)\n\nIn this example, we've enabled the Webcam, ScreenCapture and Image Editor plugins.\n\n**Try it out:** Click the \"Add Image\" button and you can either drop files or click \"browse files\" to upload them.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Image](/docs/foundations/schemas)" }, { - projectSlug: "static-formatting-toolbar", - fullSlug: "ui-components/static-formatting-toolbar", - pathFromRoot: "examples/03-ui-components/12-static-formatting-toolbar", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "static-formatting-toolbar", + "fullSlug": "ui-components/static-formatting-toolbar", + "pathFromRoot": "examples/03-ui-components/12-static-formatting-toolbar", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Basic", "UI Components", "Formatting Toolbar", - "Appearance & Styling", - ], + "Appearance & Styling" + ] }, - title: "Static Formatting Toolbar", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Static Formatting Toolbar", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - "This example shows how to make the formatting toolbar always visible and static\nabove the editor.\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", + "readme": "This example shows how to make the formatting toolbar always visible and static\nabove the editor.\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "custom-ui", - fullSlug: "ui-components/custom-ui", - pathFromRoot: "examples/03-ui-components/13-custom-ui", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "custom-ui", + "fullSlug": "ui-components/custom-ui", + "pathFromRoot": "examples/03-ui-components/13-custom-ui", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Advanced", "Inline Content", "UI Components", @@ -643,1104 +668,1145 @@ export const examples = { "Formatting Toolbar", "Suggestion Menus", "Slash Menu", - "Appearance & Styling", + "Appearance & Styling" ], - dependencies: { + "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@mui/icons-material": "^5.16.1", - "@mui/material": "^5.16.1", + "@mui/material": "^5.16.1" } as any, - pro: true, - }, - title: "UI With Third-Party Components", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", - }, - readme: - "In this example, we implement a basic editor interface using components from Material UI. We replace the Formatting Toolbar, Slash Menu, and Block Side Menu while disabling the other default elements. Additionally, the Formatting Toolbar is made static and always visible above the editor.\n\n**Relevant Docs:**\n\n- [Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Slash Menu](/docs/react/components/suggestion-menus)\n- [Side Menu](/docs/react/components/side-menu)\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "experimental-mobile-formatting-toolbar", - fullSlug: "ui-components/experimental-mobile-formatting-toolbar", - pathFromRoot: - "examples/03-ui-components/14-experimental-mobile-formatting-toolbar", - config: { - playground: true, - docs: true, - author: "areknawo", - tags: [ + "pro": true + }, + "title": "UI With Third-Party Components", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" + }, + "readme": "In this example, we implement a basic editor interface using components from Material UI. We replace the Formatting Toolbar, Slash Menu, and Block Side Menu while disabling the other default elements. Additionally, the Formatting Toolbar is made static and always visible above the editor.\n\n**Relevant Docs:**\n\n- [Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Manipulating Inline Content](/docs/reference/editor/manipulating-content)\n- [Slash Menu](/docs/react/components/suggestion-menus)\n- [Side Menu](/docs/react/components/side-menu)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "experimental-mobile-formatting-toolbar", + "fullSlug": "ui-components/experimental-mobile-formatting-toolbar", + "pathFromRoot": "examples/03-ui-components/14-experimental-mobile-formatting-toolbar", + "config": { + "playground": true, + "docs": true, + "author": "areknawo", + "tags": [ "Intermediate", "UI Components", "Formatting Toolbar", - "Appearance & Styling", - ], + "Appearance & Styling" + ] }, - title: "Experimental Mobile Formatting Toolbar", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Experimental Mobile Formatting Toolbar", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - "This example shows how to use the experimental mobile formatting toolbar, which uses [Visual Viewport API](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API) to position the toolbar right above the virtual keyboard on mobile devices.\n\nController is currently marked **experimental** due to the flickering issue with positioning (caused by delays of the Visual Viewport API)\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", + "readme": "This example shows how to use the experimental mobile formatting toolbar, which uses [Visual Viewport API](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API) to position the toolbar right above the virtual keyboard on mobile devices.\n\nController is currently marked **experimental** due to the flickering issue with positioning (caused by delays of the Visual Viewport API)\n\n**Relevant Docs:**\n\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "advanced-tables", - fullSlug: "ui-components/advanced-tables", - pathFromRoot: "examples/03-ui-components/15-advanced-tables", - config: { - playground: true, - docs: true, - author: "nperez0111", - tags: [ + "projectSlug": "advanced-tables", + "fullSlug": "ui-components/advanced-tables", + "pathFromRoot": "examples/03-ui-components/15-advanced-tables", + "config": { + "playground": true, + "docs": true, + "author": "nperez0111", + "tags": [ "Intermediate", "UI Components", "Tables", - "Appearance & Styling", - ], + "Appearance & Styling" + ] }, - title: "Advanced Tables", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Advanced Tables", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - "This example enables the following features in tables:\n\n- Split cells\n- Cell background color\n- Cell text color\n- Table row and column headers\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)", + "readme": "This example enables the following features in tables:\n\n- Split cells\n- Cell background color\n- Cell text color\n- Table row and column headers\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "link-toolbar-buttons", - fullSlug: "ui-components/link-toolbar-buttons", - pathFromRoot: "examples/03-ui-components/16-link-toolbar-buttons", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "link-toolbar-buttons", + "fullSlug": "ui-components/link-toolbar-buttons", + "pathFromRoot": "examples/03-ui-components/16-link-toolbar-buttons", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Inline Content", "UI Components", - "Link Toolbar", - ], + "Link Toolbar" + ] }, - title: "Adding Link Toolbar Buttons", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Adding Link Toolbar Buttons", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" }, - readme: - 'In this example, we add a button to the Link Toolbar which opens a browser alert.\n\n**Try it out:** Hover the link open the Link Toolbar, and click the new "Open Alert" button!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we add a button to the Link Toolbar which opens a browser alert.\n\n**Try it out:** Hover the link open the Link Toolbar, and click the new \"Open Alert\" button!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "advanced-tables-2", - fullSlug: "ui-components/advanced-tables-2", - pathFromRoot: "examples/03-ui-components/17-advanced-tables-2", - config: { - playground: true, - docs: true, - author: "must", - tags: [ + "projectSlug": "advanced-tables-2", + "fullSlug": "ui-components/advanced-tables-2", + "pathFromRoot": "examples/03-ui-components/17-advanced-tables-2", + "config": { + "playground": true, + "docs": true, + "author": "must", + "tags": [ "Intermediate", "UI Components", "Tables", + "Appearance & Styling" + ] + }, + "title": "Advanced Tables with Calculated Columns", + "group": { + "pathFromRoot": "examples/03-ui-components", + "slug": "ui-components" + }, + "readme": "This example demonstrates advanced table features including automatic calculations. It shows how to create a table with calculated columns that automatically update when values change.\n\n## Features\n\n- **Automatic Calculations**: Quantity × Price = Total for each row\n- **Grand Total**: Automatically calculated sum of all totals\n- **Real-time Updates**: Calculations update immediately when you change quantity or price values\n- **Split cells**: Merge and split table cells\n- **Cell background color**: Color individual cells\n- **Cell text color**: Change text color in cells\n- **Table row and column headers**: Use headers for better organization\n\n## How It Works\n\nThe example uses the `onChange` event listener to detect when table content changes. When a table is updated, it automatically:\n\n1. Extracts quantity and price values from each data row\n2. Calculates the total (quantity × price) for each row\n3. Updates the total column with the calculated values\n4. Calculates and updates the grand total\n\n## Code Highlights\n\n```tsx\n {\n const changes = getChanges();\n\n changes.forEach((change) => {\n if (change.type === \"update\" && change.block.type === \"table\") {\n const updatedRows = calculateTableTotals(change.block);\n if (updatedRows) {\n editor.updateBlock(change.block, {\n type: \"table\",\n content: {\n ...change.block.content,\n rows: updatedRows as any,\n } as any,\n });\n }\n }\n });\n }}\n>\n```\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Events](/docs/reference/editor/events)" + } + ] + }, + "theming": { + "pathFromRoot": "examples/04-theming", + "slug": "theming", + "projects": [ + { + "projectSlug": "theming-dom-attributes", + "fullSlug": "theming/theming-dom-attributes", + "pathFromRoot": "examples/04-theming/01-theming-dom-attributes", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Blocks", + "Appearance & Styling" + ] + }, + "title": "Adding CSS Class to Blocks", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" + }, + "readme": "In this example, we add a `hello-world-block` class to each block in the editor. We also create a CSS rule to add a border to all elements with that class.\n\n**Relevant Docs:**\n\n- [Adding DOM Attributes](/docs/react/styling-theming/adding-dom-attributes)" + }, + { + "projectSlug": "changing-font", + "fullSlug": "theming/changing-font", + "pathFromRoot": "examples/04-theming/02-changing-font", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Appearance & Styling" + ] + }, + "title": "Changing Editor Font", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" + }, + "readme": "In this example, we override some of the default editor CSS to change font within the editor.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)" + }, + { + "projectSlug": "theming-css", + "fullSlug": "theming/theming-css", + "pathFromRoot": "examples/04-theming/03-theming-css", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", "Appearance & Styling", - ], + "UI Components" + ] }, - title: "Advanced Tables with Calculated Columns", - group: { - pathFromRoot: "examples/03-ui-components", - slug: "ui-components", + "title": "Overriding CSS Styles", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" }, - readme: - 'This example demonstrates advanced table features including automatic calculations. It shows how to create a table with calculated columns that automatically update when values change.\n\n## Features\n\n- **Automatic Calculations**: Quantity × Price = Total for each row\n- **Grand Total**: Automatically calculated sum of all totals\n- **Real-time Updates**: Calculations update immediately when you change quantity or price values\n- **Split cells**: Merge and split table cells\n- **Cell background color**: Color individual cells\n- **Cell text color**: Change text color in cells\n- **Table row and column headers**: Use headers for better organization\n\n## How It Works\n\nThe example uses the `onChange` event listener to detect when table content changes. When a table is updated, it automatically:\n\n1. Extracts quantity and price values from each data row\n2. Calculates the total (quantity × price) for each row\n3. Updates the total column with the calculated values\n4. Calculates and updates the grand total\n\n## Code Highlights\n\n```tsx\n {\n const changes = getChanges();\n\n changes.forEach((change) => {\n if (change.type === "update" && change.block.type === "table") {\n const updatedRows = calculateTableTotals(change.block);\n if (updatedRows) {\n editor.updateBlock(change.block, {\n type: "table",\n content: {\n ...change.block.content,\n rows: updatedRows as any,\n } as any,\n });\n }\n }\n });\n }}\n>\n```\n\n**Relevant Docs:**\n\n- [Tables](/docs/features/blocks/tables)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Events](/docs/reference/editor/events)', + "readme": "In this example, we override some of the default editor CSS to make the editor text and hovered Slash Menu items blue.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)" }, - ], - }, - theming: { - pathFromRoot: "examples/04-theming", - slug: "theming", - projects: [ - { - projectSlug: "theming-dom-attributes", - fullSlug: "theming/theming-dom-attributes", - pathFromRoot: "examples/04-theming/01-theming-dom-attributes", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Blocks", "Appearance & Styling"], - }, - title: "Adding CSS Class to Blocks", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", - }, - readme: - "In this example, we add a `hello-world-block` class to each block in the editor. We also create a CSS rule to add a border to all elements with that class.\n\n**Relevant Docs:**\n\n- [Adding DOM Attributes](/docs/react/styling-theming/adding-dom-attributes)", - }, - { - projectSlug: "changing-font", - fullSlug: "theming/changing-font", - pathFromRoot: "examples/04-theming/02-changing-font", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Appearance & Styling"], - }, - title: "Changing Editor Font", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", - }, - readme: - "In this example, we override some of the default editor CSS to change font within the editor.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)", - }, - { - projectSlug: "theming-css", - fullSlug: "theming/theming-css", - pathFromRoot: "examples/04-theming/03-theming-css", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Appearance & Styling", "UI Components"], - }, - title: "Overriding CSS Styles", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", - }, - readme: - "In this example, we override some of the default editor CSS to make the editor text and hovered Slash Menu items blue.\n\n**Relevant Docs:**\n\n- [Overriding CSS](/docs/react/styling-theming/overriding-css)", - }, - { - projectSlug: "theming-css-variables", - fullSlug: "theming/theming-css-variables", - pathFromRoot: "examples/04-theming/04-theming-css-variables", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Appearance & Styling", "UI Components"], - }, - title: "Overriding Theme CSS Variables", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", - }, - readme: - "In this example, we override the editor's default theme CSS variables to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Theme CSS Variables](/docs/react/styling-theming/themes#css-variables)", - }, - { - projectSlug: "theming-css-variables-code", - fullSlug: "theming/theming-css-variables-code", - pathFromRoot: "examples/04-theming/05-theming-css-variables-code", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Appearance & Styling", "UI Components"], - }, - title: "Changing Themes Through Code", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", - }, - readme: - "In this example, we use the `BlockNoteView` component's `theme` props to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Changing CSS Variables Through Code](/docs/react/styling-theming/themes#programmatic-configuration)", - }, - { - projectSlug: "code-block", - fullSlug: "theming/code-block", - pathFromRoot: "examples/04-theming/06-code-block", - config: { - playground: true, - docs: true, - author: "nperez0111", - tags: ["Basic"], - dependencies: { - "@blocknote/code-block": "latest", - } as any, + { + "projectSlug": "theming-css-variables", + "fullSlug": "theming/theming-css-variables", + "pathFromRoot": "examples/04-theming/04-theming-css-variables", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Appearance & Styling", + "UI Components" + ] }, - title: "Code Block Syntax Highlighting", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", + "title": "Overriding Theme CSS Variables", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" }, - readme: - "To enable code block syntax highlighting, you can extend the editor's default schema with a new `codeBlock`, which you can pass options into when creating. By passing the default options from `@blocknote/code-block`, you can enable syntax highlighting. This is excluded by default to reduce bundle size.\n\n**Relevant Docs:**\n\n- [Code Block Syntax Highlighting](/docs/features/blocks/code-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schema](/docs/features/custom-schemas)", + "readme": "In this example, we override the editor's default theme CSS variables to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Theme CSS Variables](/docs/react/styling-theming/themes#css-variables)" }, { - projectSlug: "custom-code-block", - fullSlug: "theming/custom-code-block", - pathFromRoot: "examples/04-theming/07-custom-code-block", - config: { - playground: true, - docs: true, - author: "nperez0111", - tags: ["Basic"], - dependencies: { + "projectSlug": "theming-css-variables-code", + "fullSlug": "theming/theming-css-variables-code", + "pathFromRoot": "examples/04-theming/05-theming-css-variables-code", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Appearance & Styling", + "UI Components" + ] + }, + "title": "Changing Themes Through Code", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" + }, + "readme": "In this example, we use the `BlockNoteView` component's `theme` props to create a red theme for both light and dark modes.\n\n**Relevant Docs:**\n\n- [Changing CSS Variables Through Code](/docs/react/styling-theming/themes#programmatic-configuration)" + }, + { + "projectSlug": "code-block", + "fullSlug": "theming/code-block", + "pathFromRoot": "examples/04-theming/06-code-block", + "config": { + "playground": true, + "docs": true, + "author": "nperez0111", + "tags": [ + "Basic" + ], + "dependencies": { + "@blocknote/code-block": "latest" + } as any + }, + "title": "Code Block Syntax Highlighting", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" + }, + "readme": "To enable code block syntax highlighting, you can extend the editor's default schema with a new `codeBlock`, which you can pass options into when creating. By passing the default options from `@blocknote/code-block`, you can enable syntax highlighting. This is excluded by default to reduce bundle size.\n\n**Relevant Docs:**\n\n- [Code Block Syntax Highlighting](/docs/features/blocks/code-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Custom Schema](/docs/features/custom-schemas)" + }, + { + "projectSlug": "custom-code-block", + "fullSlug": "theming/custom-code-block", + "pathFromRoot": "examples/04-theming/07-custom-code-block", + "config": { + "playground": true, + "docs": true, + "author": "nperez0111", + "tags": [ + "Basic" + ], + "dependencies": { "@blocknote/code-block": "latest", "@shikijs/types": "^3.2.1", "@shikijs/core": "^3.2.1", "@shikijs/engine-javascript": "^3.2.1", "@shikijs/langs-precompiled": "^3.2.1", - "@shikijs/themes": "^3.2.1", - } as any, + "@shikijs/themes": "^3.2.1" + } as any }, - title: "Custom Code Block Theme & Language", - group: { - pathFromRoot: "examples/04-theming", - slug: "theming", + "title": "Custom Code Block Theme & Language", + "group": { + "pathFromRoot": "examples/04-theming", + "slug": "theming" }, - readme: - "To configure a code block highlighting theme and language, you can extend the editor's default schema with a new `codeBlock`, which you can pass options into when creating. You can then use a shiki highlighter to add custom syntax highlighting.\n\nFirst use the [shiki-codegen](https://shiki.style/packages/codegen) CLI to create a `shiki.bundle.ts` file. You can then pass this file into the `codeBlock` options when creating it.\n\n**Relevant Docs:**\n\n- [Code Blocks](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)\n- [Custom Schema](/docs/features/custom-schemas)", - }, - ], + "readme": "To configure a code block highlighting theme and language, you can extend the editor's default schema with a new `codeBlock`, which you can pass options into when creating. You can then use a shiki highlighter to add custom syntax highlighting.\n\nFirst use the [shiki-codegen](https://shiki.style/packages/codegen) CLI to create a `shiki.bundle.ts` file. You can then pass this file into the `codeBlock` options when creating it.\n\n**Relevant Docs:**\n\n- [Code Blocks](/docs/features/blocks/code-blocks)\n- [shiki-codegen](https://shiki.style/packages/codegen)\n- [Custom Schema](/docs/features/custom-schemas)" + } + ] }, - interoperability: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - projects: [ - { - projectSlug: "converting-blocks-to-html", - fullSlug: "interoperability/converting-blocks-to-html", - pathFromRoot: - "examples/05-interoperability/01-converting-blocks-to-html", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Blocks", "Import/Export"], - }, - title: "Converting Blocks to HTML", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - "This example exports the current document (all blocks) as HTML and displays it below the editor.\n\n**Try it out:** Edit the document to see the HTML representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to HTML](/docs/features/export/html)", - }, - { - projectSlug: "converting-blocks-from-html", - fullSlug: "interoperability/converting-blocks-from-html", - pathFromRoot: - "examples/05-interoperability/02-converting-blocks-from-html", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic", "Blocks", "Import/Export"], - }, - title: "Parsing HTML to Blocks", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the HTML in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing HTML to Blocks](/docs/features/import/html)", - }, - { - projectSlug: "converting-blocks-to-md", - fullSlug: "interoperability/converting-blocks-to-md", - pathFromRoot: "examples/05-interoperability/03-converting-blocks-to-md", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic", "Blocks", "Import/Export"], - }, - title: "Converting Blocks to Markdown", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - "This example exports the current document (all blocks) as Markdown and displays it below the editor.\n\n**Try it out:** Edit the document to see the Markdown representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to Markdown](/docs/features/export/markdown)", - }, - { - projectSlug: "converting-blocks-from-md", - fullSlug: "interoperability/converting-blocks-from-md", - pathFromRoot: - "examples/05-interoperability/04-converting-blocks-from-md", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Basic", "Blocks", "Import/Export"], - }, - title: "Parsing Markdown to Blocks", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the Markdown in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing Markdown to Blocks](/docs/features/import/markdown)", - }, - { - projectSlug: "converting-blocks-to-pdf", - fullSlug: "interoperability/converting-blocks-to-pdf", - pathFromRoot: - "examples/05-interoperability/05-converting-blocks-to-pdf", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Interoperability"], - dependencies: { + "interoperability": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability", + "projects": [ + { + "projectSlug": "converting-blocks-to-html", + "fullSlug": "interoperability/converting-blocks-to-html", + "pathFromRoot": "examples/05-interoperability/01-converting-blocks-to-html", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Blocks", + "Import/Export" + ] + }, + "title": "Converting Blocks to HTML", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example exports the current document (all blocks) as HTML and displays it below the editor.\n\n**Try it out:** Edit the document to see the HTML representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to HTML](/docs/features/export/html)" + }, + { + "projectSlug": "converting-blocks-from-html", + "fullSlug": "interoperability/converting-blocks-from-html", + "pathFromRoot": "examples/05-interoperability/02-converting-blocks-from-html", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic", + "Blocks", + "Import/Export" + ] + }, + "title": "Parsing HTML to Blocks", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the HTML in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing HTML to Blocks](/docs/features/import/html)" + }, + { + "projectSlug": "converting-blocks-to-md", + "fullSlug": "interoperability/converting-blocks-to-md", + "pathFromRoot": "examples/05-interoperability/03-converting-blocks-to-md", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic", + "Blocks", + "Import/Export" + ] + }, + "title": "Converting Blocks to Markdown", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example exports the current document (all blocks) as Markdown and displays it below the editor.\n\n**Try it out:** Edit the document to see the Markdown representation!\n\n**Relevant Docs:**\n\n- [Converting Blocks to Markdown](/docs/features/export/markdown)" + }, + { + "projectSlug": "converting-blocks-from-md", + "fullSlug": "interoperability/converting-blocks-from-md", + "pathFromRoot": "examples/05-interoperability/04-converting-blocks-from-md", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Basic", + "Blocks", + "Import/Export" + ] + }, + "title": "Parsing Markdown to Blocks", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example shows how you can convert HTML content to a BlockNote document.\n\nNote that the editor itself is locked for editing by setting `editable` to `false`.\n\n**Try it out:** Edit the Markdown in the textarea to see the BlockNote document update!\n\n**Relevant Docs:**\n\n- [Parsing Markdown to Blocks](/docs/features/import/markdown)" + }, + { + "projectSlug": "converting-blocks-to-pdf", + "fullSlug": "interoperability/converting-blocks-to-pdf", + "pathFromRoot": "examples/05-interoperability/05-converting-blocks-to-pdf", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Interoperability" + ], + "dependencies": { "@blocknote/xl-pdf-exporter": "latest", "@blocknote/xl-multi-column": "latest", - "@react-pdf/renderer": "^4.3.0", + "@react-pdf/renderer": "^4.3.0" } as any, - pro: true, - }, - title: "Exporting documents to PDF", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - 'This example exports the current document (all blocks) as an PDF file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .pdf" at the top to download the PDF file.', - }, - { - projectSlug: "converting-blocks-to-docx", - fullSlug: "interoperability/converting-blocks-to-docx", - pathFromRoot: - "examples/05-interoperability/06-converting-blocks-to-docx", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [""], - dependencies: { + "pro": true + }, + "title": "Exporting documents to PDF", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example exports the current document (all blocks) as an PDF file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .pdf\" at the top to download the PDF file." + }, + { + "projectSlug": "converting-blocks-to-docx", + "fullSlug": "interoperability/converting-blocks-to-docx", + "pathFromRoot": "examples/05-interoperability/06-converting-blocks-to-docx", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "" + ], + "dependencies": { "@blocknote/xl-docx-exporter": "latest", "@blocknote/xl-multi-column": "latest", - docx: "^9.0.2", + "docx": "^9.0.2" } as any, - pro: true, - }, - title: "Exporting documents to DOCX (Office Open XML)", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - 'This example exports the current document (all blocks) as an Microsoft Word Document (DOCX) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .docx" at the top to download the DOCX file.', - }, - { - projectSlug: "converting-blocks-to-odt", - fullSlug: "interoperability/converting-blocks-to-odt", - pathFromRoot: - "examples/05-interoperability/07-converting-blocks-to-odt", - config: { - playground: true, - docs: true, - author: "areknawo", - tags: [""], - dependencies: { + "pro": true + }, + "title": "Exporting documents to DOCX (Office Open XML)", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example exports the current document (all blocks) as an Microsoft Word Document (DOCX) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .docx\" at the top to download the DOCX file." + }, + { + "projectSlug": "converting-blocks-to-odt", + "fullSlug": "interoperability/converting-blocks-to-odt", + "pathFromRoot": "examples/05-interoperability/07-converting-blocks-to-odt", + "config": { + "playground": true, + "docs": true, + "author": "areknawo", + "tags": [ + "" + ], + "dependencies": { "@blocknote/xl-odt-exporter": "latest", - "@blocknote/xl-multi-column": "latest", + "@blocknote/xl-multi-column": "latest" } as any, - pro: true, - }, - title: "Exporting documents to ODT (Open Document Text)", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", - }, - readme: - 'This example exports the current document (all blocks) as an Open Document Text (ODT) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download .odt" at the top to download the ODT file.', - }, - { - projectSlug: "converting-blocks-to-react-email", - fullSlug: "interoperability/converting-blocks-to-react-email", - pathFromRoot: - "examples/05-interoperability/08-converting-blocks-to-react-email", - config: { - playground: true, - docs: true, - author: "jmarbutt", - tags: [""], - dependencies: { + "pro": true + }, + "title": "Exporting documents to ODT (Open Document Text)", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" + }, + "readme": "This example exports the current document (all blocks) as an Open Document Text (ODT) file and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download .odt\" at the top to download the ODT file." + }, + { + "projectSlug": "converting-blocks-to-react-email", + "fullSlug": "interoperability/converting-blocks-to-react-email", + "pathFromRoot": "examples/05-interoperability/08-converting-blocks-to-react-email", + "config": { + "playground": true, + "docs": true, + "author": "jmarbutt", + "tags": [ + "" + ], + "dependencies": { "@blocknote/xl-email-exporter": "latest", - "@react-email/render": "^1.1.2", + "@react-email/render": "^1.1.2" } as any, - pro: true, + "pro": true }, - title: "Exporting documents to Email (HTML)", - group: { - pathFromRoot: "examples/05-interoperability", - slug: "interoperability", + "title": "Exporting documents to Email (HTML)", + "group": { + "pathFromRoot": "examples/05-interoperability", + "slug": "interoperability" }, - readme: - 'This example exports the current document (all blocks) as an HTML file for use in emails, and downloads it to your computer.\n\n**Try it out:** Edit the document and click "Download email .html" at the top to download the HTML file.', - }, - ], + "readme": "This example exports the current document (all blocks) as an HTML file for use in emails, and downloads it to your computer.\n\n**Try it out:** Edit the document and click \"Download email .html\" at the top to download the HTML file." + } + ] }, "custom-schema": { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - projects: [ - { - projectSlug: "alert-block", - fullSlug: "custom-schema/alert-block", - pathFromRoot: "examples/06-custom-schema/01-alert-block", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema", + "projects": [ + { + "projectSlug": "alert-block", + "fullSlug": "custom-schema/alert-block", + "pathFromRoot": "examples/06-custom-schema/01-alert-block", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Blocks", "Custom Schemas", "Suggestion Menus", - "Slash Menu", + "Slash Menu" ], - dependencies: { + "dependencies": { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1", - } as any, + "react-icons": "^5.2.1" + } as any }, - title: "Alert Block", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", + "title": "Alert Block", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" }, - readme: - 'In this example, we create a custom `Alert` block which is used to emphasize text.\n\n**Try it out:** Click the "!" icon to change the alert type!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we create a custom `Alert` block which is used to emphasize text.\n\n**Try it out:** Click the \"!\" icon to change the alert type!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "suggestion-menus-mentions", - fullSlug: "custom-schema/suggestion-menus-mentions", - pathFromRoot: "examples/06-custom-schema/02-suggestion-menus-mentions", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: [ + "projectSlug": "suggestion-menus-mentions", + "fullSlug": "custom-schema/suggestion-menus-mentions", + "pathFromRoot": "examples/06-custom-schema/02-suggestion-menus-mentions", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ "Intermediate", "Inline Content", "Custom Schemas", - "Suggestion Menus", - ], + "Suggestion Menus" + ] }, - title: "Mentions Menu", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", + "title": "Mentions Menu", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" }, - readme: - 'In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the "@" character.\n\n**Try it out:** Press the "@" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus#creating-additional-suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we create a custom `Mention` inline content type which is used to tag people. In addition, we create a new Suggestion Menu for mentions which opens with the \"@\" character.\n\n**Try it out:** Press the \"@\" key to open the mentions menu and insert a mention!\n\n**Relevant Docs:**\n\n- [Custom Inline Content Types](/docs/features/custom-schemas/custom-inline-content)\n- [Creating Suggestion Menus](/docs/react/components/suggestion-menus#creating-additional-suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "font-style", - fullSlug: "custom-schema/font-style", - pathFromRoot: "examples/06-custom-schema/03-font-style", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "font-style", + "fullSlug": "custom-schema/font-style", + "pathFromRoot": "examples/06-custom-schema/03-font-style", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Inline Content", "Custom Schemas", - "Formatting Toolbar", + "Formatting Toolbar" ], - dependencies: { - "react-icons": "^5.2.1", - } as any, - }, - title: "Font Style", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: - "In this example, we create a custom `Font` style which is used to set the `fontFamily` style. In addition, we create a Formatting Toolbar button which sets the `Font` style on the selected text.\n\n**Try it out:** Highlight some text to open the Formatting Toolbar and set the `Font` style!\n\n**Relevant Docs:**\n\n- [Custom Styles](/docs/features/custom-schemas/custom-styles)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - { - projectSlug: "pdf-file-block", - fullSlug: "custom-schema/pdf-file-block", - pathFromRoot: "examples/06-custom-schema/04-pdf-file-block", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "dependencies": { + "react-icons": "^5.2.1" + } as any + }, + "title": "Font Style", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "In this example, we create a custom `Font` style which is used to set the `fontFamily` style. In addition, we create a Formatting Toolbar button which sets the `Font` style on the selected text.\n\n**Try it out:** Highlight some text to open the Formatting Toolbar and set the `Font` style!\n\n**Relevant Docs:**\n\n- [Custom Styles](/docs/features/custom-schemas/custom-styles)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "pdf-file-block", + "fullSlug": "custom-schema/pdf-file-block", + "pathFromRoot": "examples/06-custom-schema/04-pdf-file-block", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Blocks", "Custom Schemas", "Suggestion Menus", - "Slash Menu", + "Slash Menu" ], - dependencies: { + "dependencies": { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1", + "react-icons": "^5.2.1" } as any, - pro: true, + "pro": true }, - title: "PDF Block", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", + "title": "PDF Block", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" }, - readme: - 'In this example, we create a custom `PDF` block which extends the built-in `File` block. In addition, we create a Slash Menu item which inserts a `PDF` block.\n\n**Try it out:** Press the "/" key to open the Slash Menu and insert an `PDF` block!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, we create a custom `PDF` block which extends the built-in `File` block. In addition, we create a Slash Menu item which inserts a `PDF` block.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and insert an `PDF` block!\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "alert-block-full-ux", - fullSlug: "custom-schema/alert-block-full-ux", - pathFromRoot: "examples/06-custom-schema/05-alert-block-full-ux", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: [ + "projectSlug": "alert-block-full-ux", + "fullSlug": "custom-schema/alert-block-full-ux", + "pathFromRoot": "examples/06-custom-schema/05-alert-block-full-ux", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ "Intermediate", "Blocks", "Custom Schemas", "Formatting Toolbar", "Suggestion Menus", - "Slash Menu", + "Slash Menu" ], - dependencies: { + "dependencies": { "@mantine/core": "^7.17.3", - "react-icons": "^5.2.1", - } as any, - }, - title: "Alert Block with Full UX", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: - 'In this example, we create a custom `Alert` block which is used to emphasize text, same as in the [minimal `Alert` block example](/examples/custom-schema/alert-block). However, in this example, we also add a command to insert the block via the Slash Menu, and an entry in the Formatting Toolbar\'s Block Type Select to change the current block to an `Alert`.\n\n**Try it out:** Press the "/" key to open the Slash Menu and insert an `Alert` block! Or highlight text in a paragraph, then change the block type to an `Alert` using the Block Type Select in the Formatting Toolbar!\n\n**Relevant Docs:**\n\n- [Minimal Alert Block Example](/examples/custom-schema/alert-block)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)', - }, - { - projectSlug: "toggleable-blocks", - fullSlug: "custom-schema/toggleable-blocks", - pathFromRoot: "examples/06-custom-schema/06-toggleable-blocks", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Basic"], - }, - title: "Toggleable Custom Blocks", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: - "This example shows how to create custom blocks with a toggle button to show/hide their children, like with the default toggle heading and list item blocks. This is done using the use the `ToggleWrapper` component from `@blocknote/react`.\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Default Schema](/docs/features/blocks)", - }, - { - projectSlug: "draggable-inline-content", - fullSlug: "custom-schema/draggable-inline-content", - pathFromRoot: "examples/06-custom-schema/draggable-inline-content", - config: { - playground: true, - docs: false, - author: "hectorzhuang", - tags: [], - }, - title: "Draggable Inline Content", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: "", - }, - { - projectSlug: "react-custom-blocks", - fullSlug: "custom-schema/react-custom-blocks", - pathFromRoot: "examples/06-custom-schema/react-custom-blocks", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Blocks - React API", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: "", - }, - { - projectSlug: "react-custom-inline-content", - fullSlug: "custom-schema/react-custom-inline-content", - pathFromRoot: "examples/06-custom-schema/react-custom-inline-content", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Inline Content - React API", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: "", - }, - { - projectSlug: "react-custom-styles", - fullSlug: "custom-schema/react-custom-styles", - pathFromRoot: "examples/06-custom-schema/react-custom-styles", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Styles - React API", - group: { - pathFromRoot: "examples/06-custom-schema", - slug: "custom-schema", - }, - readme: "", - }, - ], + "react-icons": "^5.2.1" + } as any + }, + "title": "Alert Block with Full UX", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "In this example, we create a custom `Alert` block which is used to emphasize text, same as in the [minimal `Alert` block example](/examples/custom-schema/alert-block). However, in this example, we also add a command to insert the block via the Slash Menu, and an entry in the Formatting Toolbar's Block Type Select to change the current block to an `Alert`.\n\n**Try it out:** Press the \"/\" key to open the Slash Menu and insert an `Alert` block! Or highlight text in a paragraph, then change the block type to an `Alert` using the Block Type Select in the Formatting Toolbar!\n\n**Relevant Docs:**\n\n- [Minimal Alert Block Example](/examples/custom-schema/alert-block)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)\n- [Changing Block Type Select Items](/docs/react/components/formatting-toolbar)\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)" + }, + { + "projectSlug": "toggleable-blocks", + "fullSlug": "custom-schema/toggleable-blocks", + "pathFromRoot": "examples/06-custom-schema/06-toggleable-blocks", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Basic" + ] + }, + "title": "Toggleable Custom Blocks", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "This example shows how to create custom blocks with a toggle button to show/hide their children, like with the default toggle heading and list item blocks. This is done using the use the `ToggleWrapper` component from `@blocknote/react`.\n\n**Relevant Docs:**\n\n- [Custom Blocks](/docs/features/custom-schemas/custom-blocks)\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Default Schema](/docs/features/blocks)" + }, + { + "projectSlug": "draggable-inline-content", + "fullSlug": "custom-schema/draggable-inline-content", + "pathFromRoot": "examples/06-custom-schema/draggable-inline-content", + "config": { + "playground": true, + "docs": false, + "author": "hectorzhuang", + "tags": [] + }, + "title": "Draggable Inline Content", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "" + }, + { + "projectSlug": "react-custom-blocks", + "fullSlug": "custom-schema/react-custom-blocks", + "pathFromRoot": "examples/06-custom-schema/react-custom-blocks", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Blocks - React API", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "" + }, + { + "projectSlug": "react-custom-inline-content", + "fullSlug": "custom-schema/react-custom-inline-content", + "pathFromRoot": "examples/06-custom-schema/react-custom-inline-content", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Inline Content - React API", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "" + }, + { + "projectSlug": "react-custom-styles", + "fullSlug": "custom-schema/react-custom-styles", + "pathFromRoot": "examples/06-custom-schema/react-custom-styles", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Styles - React API", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + }, + "readme": "" + } + ] }, - collaboration: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", - projects: [ - { - projectSlug: "partykit", - fullSlug: "collaboration/partykit", - pathFromRoot: "examples/07-collaboration/01-partykit", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Advanced", "Saving/Loading", "Collaboration"], - dependencies: { + "collaboration": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration", + "projects": [ + { + "projectSlug": "partykit", + "fullSlug": "collaboration/partykit", + "pathFromRoot": "examples/07-collaboration/01-partykit", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Advanced", + "Saving/Loading", + "Collaboration" + ], + "dependencies": { "y-partykit": "^0.0.25", - yjs: "^13.6.27", - } as any, + "yjs": "^13.6.27" + } as any }, - title: "Collaborative Editing with PartyKit", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Collaborative Editing with PartyKit", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - "In this example, we use PartyKit to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [PartyKit](/docs/features/collaboration#partykit)", + "readme": "In this example, we use PartyKit to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [PartyKit](/docs/features/collaboration#partykit)" }, { - projectSlug: "liveblocks", - fullSlug: "collaboration/liveblocks", - pathFromRoot: "examples/07-collaboration/02-liveblocks", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Advanced", "Saving/Loading", "Collaboration"], - dependencies: { + "projectSlug": "liveblocks", + "fullSlug": "collaboration/liveblocks", + "pathFromRoot": "examples/07-collaboration/02-liveblocks", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Advanced", + "Saving/Loading", + "Collaboration" + ], + "dependencies": { "@liveblocks/client": "3.7.1-tiptap3", "@liveblocks/react": "3.7.1-tiptap3", "@liveblocks/react-blocknote": "3.7.1-tiptap3", "@liveblocks/react-tiptap": "3.7.1-tiptap3", "@liveblocks/react-ui": "3.7.1-tiptap3", - yjs: "^13.6.27", - } as any, + "yjs": "^13.6.27" + } as any }, - title: "Collaborative Editing with Liveblocks", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Collaborative Editing with Liveblocks", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - "In this example, we use\nthe [Liveblocks + BlockNote setup guide](https://liveblocks.io/docs/get-started/react-blocknote)\nto create a collaborative BlockNote editor, where multiple people can work on\nthe same document in real-time.\n\nUsers can also add comments to the documents to start threads, which are\ndisplayed next to the editor. As well as that, they can react to, reply to, and\nresolve existing comments.\n\n**Try it out:** Open this page in a new browser tab or window to see it in\naction!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Liveblocks](/docs/features/collaboration#liveblocks)\n\n**From Liveblocks Website:**\n\n- [Get Started with BlockNote](https://liveblocks.io/docs/get-started/react-blocknote)\n- [Ready Made Features](https://liveblocks.io/docs/ready-made-features/text-editor/blocknote)\n- [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-react-blocknote)\n- [Advanced Example](https://liveblocks.io/examples/collaborative-text-editor/nextjs-blocknote)", + "readme": "In this example, we use\nthe [Liveblocks + BlockNote setup guide](https://liveblocks.io/docs/get-started/react-blocknote)\nto create a collaborative BlockNote editor, where multiple people can work on\nthe same document in real-time.\n\nUsers can also add comments to the documents to start threads, which are\ndisplayed next to the editor. As well as that, they can react to, reply to, and\nresolve existing comments.\n\n**Try it out:** Open this page in a new browser tab or window to see it in\naction!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Liveblocks](/docs/features/collaboration#liveblocks)\n\n**From Liveblocks Website:**\n\n- [Get Started with BlockNote](https://liveblocks.io/docs/get-started/react-blocknote)\n- [Ready Made Features](https://liveblocks.io/docs/ready-made-features/text-editor/blocknote)\n- [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-react-blocknote)\n- [Advanced Example](https://liveblocks.io/examples/collaborative-text-editor/nextjs-blocknote)" }, { - projectSlug: "y-sweet", - fullSlug: "collaboration/y-sweet", - pathFromRoot: "examples/07-collaboration/03-y-sweet", - config: { - playground: true, - docs: true, - author: "jakelazaroff", - tags: ["Advanced", "Saving/Loading", "Collaboration"], - dependencies: { + "projectSlug": "y-sweet", + "fullSlug": "collaboration/y-sweet", + "pathFromRoot": "examples/07-collaboration/03-y-sweet", + "config": { + "playground": true, + "docs": true, + "author": "jakelazaroff", + "tags": [ + "Advanced", + "Saving/Loading", + "Collaboration" + ], + "dependencies": { + "@y-sweet/react": "^0.6.3" + } as any + }, + "title": "Collaborative Editing with Y-Sweet", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" + }, + "readme": "In this example, we use Y-Sweet to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open the [Y-Sweet BlockNote demo](https://demos.y-sweet.dev/blocknote) in multiple browser tabs to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)" + }, + { + "projectSlug": "comments", + "fullSlug": "collaboration/comments", + "pathFromRoot": "examples/07-collaboration/04-comments", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "Advanced", + "Comments", + "Collaboration" + ], + "dependencies": { "@y-sweet/react": "^0.6.3", - } as any, + "@mantine/core": "^7.10.1" + } as any }, - title: "Collaborative Editing with Y-Sweet", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Comments & Threads", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - "In this example, we use Y-Sweet to let multiple users collaborate on a single BlockNote document in real-time.\n\n**Try it out:** Open the [Y-Sweet BlockNote demo](https://demos.y-sweet.dev/blocknote) in multiple browser tabs to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)", + "readme": "In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text.\n\n**Try it out:** Click the \"Add comment\" button in the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a comment!\n\n**Relevant Docs:**\n\n- [Comments](/docs/features/collaboration/comments)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "comments", - fullSlug: "collaboration/comments", - pathFromRoot: "examples/07-collaboration/04-comments", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["Advanced", "Comments", "Collaboration"], - dependencies: { - "@y-sweet/react": "^0.6.3", - "@mantine/core": "^7.10.1", - } as any, - }, - title: "Comments & Threads", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", - }, - readme: - 'In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text.\n\n**Try it out:** Click the "Add comment" button in the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a comment!\n\n**Relevant Docs:**\n\n- [Comments](/docs/features/collaboration/comments)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)', - }, - { - projectSlug: "comments-with-sidebar", - fullSlug: "collaboration/comments-with-sidebar", - pathFromRoot: "examples/07-collaboration/05-comments-with-sidebar", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["Advanced", "Comments", "Collaboration"], - dependencies: { + "projectSlug": "comments-with-sidebar", + "fullSlug": "collaboration/comments-with-sidebar", + "pathFromRoot": "examples/07-collaboration/05-comments-with-sidebar", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "Advanced", + "Comments", + "Collaboration" + ], + "dependencies": { "@y-sweet/react": "^0.6.3", - "@mantine/core": "^7.10.1", - } as any, + "@mantine/core": "^7.10.1" + } as any }, - title: "Threads Sidebar", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Threads Sidebar", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - 'In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text. The comments are shown in a separate sidebar using the `ThreadsSidebar` component.\n\n**Try it out:** Click the "Add comment" button in\nthe [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a\ncomment!\n\n**Relevant Docs:**\n\n- [Comments Sidebar](/docs/features/collaboration/comments#sidebar-view)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)', + "readme": "In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text. The comments are shown in a separate sidebar using the `ThreadsSidebar` component.\n\n**Try it out:** Click the \"Add comment\" button in\nthe [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a\ncomment!\n\n**Relevant Docs:**\n\n- [Comments Sidebar](/docs/features/collaboration/comments#sidebar-view)\n- [Real-time collaboration](/docs/features/collaboration)\n- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "ghost-writer", - fullSlug: "collaboration/ghost-writer", - pathFromRoot: "examples/07-collaboration/06-ghost-writer", - config: { - playground: true, - docs: false, - author: "nperez0111", - tags: ["Advanced", "Development", "Collaboration"], - dependencies: { + "projectSlug": "ghost-writer", + "fullSlug": "collaboration/ghost-writer", + "pathFromRoot": "examples/07-collaboration/06-ghost-writer", + "config": { + "playground": true, + "docs": false, + "author": "nperez0111", + "tags": [ + "Advanced", + "Development", + "Collaboration" + ], + "dependencies": { "y-partykit": "^0.0.25", - yjs: "^13.6.27", - } as any, + "yjs": "^13.6.27" + } as any }, - title: "Ghost Writer", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Ghost Writer", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - "In this example, we use a local Yjs document to store the document state, and have a ghost writer that edits the document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", + "readme": "In this example, we use a local Yjs document to store the document state, and have a ghost writer that edits the document in real-time.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" }, { - projectSlug: "forking", - fullSlug: "collaboration/forking", - pathFromRoot: "examples/07-collaboration/07-forking", - config: { - playground: true, - docs: false, - author: "nperez0111", - tags: ["Advanced", "Development", "Collaboration"], - dependencies: { + "projectSlug": "forking", + "fullSlug": "collaboration/forking", + "pathFromRoot": "examples/07-collaboration/07-forking", + "config": { + "playground": true, + "docs": false, + "author": "nperez0111", + "tags": [ + "Advanced", + "Development", + "Collaboration" + ], + "dependencies": { "y-partykit": "^0.0.25", - yjs: "^13.6.27", - } as any, + "yjs": "^13.6.27" + } as any }, - title: "Collaborative Editing with Forking", - group: { - pathFromRoot: "examples/07-collaboration", - slug: "collaboration", + "title": "Collaborative Editing with Forking", + "group": { + "pathFromRoot": "examples/07-collaboration", + "slug": "collaboration" }, - readme: - "In this example, we can fork a document and edit it independently of other collaborators. Then, we can choose to merge the changes back into the original document, or discard the changes.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)", - }, - ], + "readme": "In this example, we can fork a document and edit it independently of other collaborators. Then, we can choose to merge the changes back into the original document, or discard the changes.\n\n**Try it out:** Open this page in a new browser tab or window to see it in action!\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)" + } + ] }, - extensions: { - pathFromRoot: "examples/08-extensions", - slug: "extensions", - projects: [ - { - projectSlug: "tiptap-arrow-conversion", - fullSlug: "extensions/tiptap-arrow-conversion", - pathFromRoot: "examples/08-extensions/01-tiptap-arrow-conversion", - config: { - playground: true, - docs: true, - author: "komsenapati", - tags: ["Extension"], - pro: true, - dependencies: { - "@tiptap/core": "^3.4.3", - } as any, - }, - title: "TipTap extension (arrow InputRule)", - group: { - pathFromRoot: "examples/08-extensions", - slug: "extensions", - }, - readme: - "This example shows how to set up a BlockNote editor with a TipTap extension that registers an InputRule to convert `->` into `→`.\n\n**Try it out:** Type `->` anywhere in the editor and see how it's automatically converted to a single arrow unicode character.", - }, - ], + "extensions": { + "pathFromRoot": "examples/08-extensions", + "slug": "extensions", + "projects": [ + { + "projectSlug": "tiptap-arrow-conversion", + "fullSlug": "extensions/tiptap-arrow-conversion", + "pathFromRoot": "examples/08-extensions/01-tiptap-arrow-conversion", + "config": { + "playground": true, + "docs": true, + "author": "komsenapati", + "tags": [ + "Extension" + ], + "pro": true, + "dependencies": { + "@tiptap/core": "^3.4.3" + } as any + }, + "title": "TipTap extension (arrow InputRule)", + "group": { + "pathFromRoot": "examples/08-extensions", + "slug": "extensions" + }, + "readme": "This example shows how to set up a BlockNote editor with a TipTap extension that registers an InputRule to convert `->` into `→`.\n\n**Try it out:** Type `->` anywhere in the editor and see how it's automatically converted to a single arrow unicode character." + } + ] }, - ai: { - pathFromRoot: "examples/09-ai", - slug: "ai", - projects: [ - { - projectSlug: "minimal", - fullSlug: "ai/minimal", - pathFromRoot: "examples/09-ai/01-minimal", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["AI", "llm"], - dependencies: { + "ai": { + "pathFromRoot": "examples/09-ai", + "slug": "ai", + "projects": [ + { + "projectSlug": "minimal", + "fullSlug": "ai/minimal", + "pathFromRoot": "examples/09-ai/01-minimal", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - "@ai-sdk/groq": "^2.0.16", - zustand: "^5.0.3", - } as any, - }, - title: "Rich Text editor AI integration", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "This example shows the minimal setup to add AI integration to your BlockNote rich text editor.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)", - }, - { - projectSlug: "playground", - fullSlug: "ai/playground", - pathFromRoot: "examples/09-ai/02-playground", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["AI", "llm"], - dependencies: { + "ai": "^5.0.45", + "zustand": "^5.0.3" + } as any + }, + "title": "Rich Text editor AI integration", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "This example shows the minimal setup to add AI integration to your BlockNote rich text editor.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)" + }, + { + "projectSlug": "playground", + "fullSlug": "ai/playground", + "pathFromRoot": "examples/09-ai/02-playground", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - "@ai-sdk/google": "^2.0.11", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/openai-compatible": "^1.0.13", - "@ai-sdk/groq": "^2.0.16", - "@ai-sdk/anthropic": "^2.0.9", - "@ai-sdk/mistral": "^2.0.12", - zustand: "^5.0.3", - } as any, - }, - title: "AI Playground", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "The AI Playground example shows how to customize different options of the AI Extension such as model type and streaming mode.\n\nChange the configuration, the highlight some text to access the AI menu, or type `/ai` anywhere in the editor.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [BlockNote AI Reference](/docs/features/ai/reference)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)", - }, - { - projectSlug: "custom-ai-menu-items", - fullSlug: "ai/custom-ai-menu-items", - pathFromRoot: "examples/09-ai/03-custom-ai-menu-items", - config: { - playground: true, - docs: true, - author: "matthewlipski", - tags: ["AI", "llm"], - dependencies: { + "ai": "^5.0.45", + "zustand": "^5.0.3" + } as any + }, + "title": "AI Playground", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "Explore different LLM models integrated with BlockNote in the AI Playground.\n\nChange the configuration, then highlight some text to access the AI menu, or type `/ai` anywhere in the editor.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [BlockNote AI Reference](/docs/features/ai/reference)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus)" + }, + { + "projectSlug": "custom-ai-menu-items", + "fullSlug": "ai/custom-ai-menu-items", + "pathFromRoot": "examples/09-ai/03-custom-ai-menu-items", + "config": { + "playground": true, + "docs": true, + "author": "matthewlipski", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - "@ai-sdk/openai": "^2.0.23", - "@ai-sdk/groq": "^2.0.16", + "ai": "^5.0.45", "react-icons": "^5.2.1", - zustand: "^5.0.3", - } as any, - }, - title: "Adding AI Menu Items", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - 'In this example, we add two items to the AI Menu. The first prompts the AI to make the selected text more casual, and can be found by selecting some text and click the AI (stars) button. The second prompts the AI to give ideas on related topics to extend the document with, and can be found by clicking the "Ask AI" Slash Menu item.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Custom AI Menu Items](/docs/features/ai/custom-commands)', - }, - { - projectSlug: "with-collaboration", - fullSlug: "ai/with-collaboration", - pathFromRoot: "examples/09-ai/04-with-collaboration", - config: { - playground: true, - docs: false, - author: "nperez0111", - tags: ["AI", "llm"], - dependencies: { + "zustand": "^5.0.3" + } as any + }, + "title": "Adding AI Menu Items", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "In this example, we add two items to the AI Menu. The first prompts the AI to make the selected text more casual, and can be found by selecting some text and click the AI (stars) button. The second prompts the AI to give ideas on related topics to extend the document with, and can be found by clicking the \"Ask AI\" Slash Menu item.\n\nSelect some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality.\n\n**Relevant Docs:**\n\n- [Getting Stared with BlockNote AI](/docs/features/ai/getting-started)\n- [Custom AI Menu Items](/docs/features/ai/custom-commands)" + }, + { + "projectSlug": "with-collaboration", + "fullSlug": "ai/with-collaboration", + "pathFromRoot": "examples/09-ai/04-with-collaboration", + "config": { + "playground": true, + "docs": false, + "author": "nperez0111", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - "@ai-sdk/groq": "^2.0.16", + "ai": "^5.0.45", "y-partykit": "^0.0.25", - yjs: "^13.6.27", - zustand: "^5.0.3", - } as any, - }, - title: "AI + Ghost Writer", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)\n- [Getting Stared with BlockNote AI](/docs/features/ai/setup)", - }, - { - projectSlug: "manual-execution", - fullSlug: "ai/manual-execution", - pathFromRoot: "examples/09-ai/05-manual-execution", - config: { - playground: true, - docs: false, - author: "yousefed", - tags: ["AI", "llm"], - dependencies: { + "yjs": "^13.6.27", + "zustand": "^5.0.3" + } as any + }, + "title": "AI + Ghost Writer", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.\n\n**Relevant Docs:**\n\n- [Editor Setup](/docs/getting-started/editor-setup)\n- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)\n- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)\n- [Getting Stared with BlockNote AI](/docs/features/ai/setup)" + }, + { + "projectSlug": "manual-execution", + "fullSlug": "ai/manual-execution", + "pathFromRoot": "examples/09-ai/05-manual-execution", + "config": { + "playground": true, + "docs": false, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - "@ai-sdk/groq": "^2.0.16", + "ai": "^5.0.45", "y-partykit": "^0.0.25", - yjs: "^13.6.27", - zustand: "^5.0.3", - } as any, - }, - title: "AI manual execution", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor", - }, - { - projectSlug: "server-execution", - fullSlug: "ai/server-execution", - pathFromRoot: "examples/09-ai/06-server-execution", - config: { - playground: true, - docs: true, - author: "yousefed", - tags: ["AI", "llm"], - dependencies: { + "yjs": "^13.6.27", + "zustand": "^5.0.3" + } as any + }, + "title": "AI manual execution", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor." + }, + { + "projectSlug": "client-side-transport", + "fullSlug": "ai/client-side-transport", + "pathFromRoot": "examples/09-ai/06-client-side-transport", + "config": { + "playground": true, + "docs": true, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { + "@ai-sdk/groq": "^2.0.16", "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - zustand: "^5.0.3", - } as any, - }, - title: "AI Integration with server LLM execution", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor", - }, - { - projectSlug: "server-promptbuilder", - fullSlug: "ai/server-promptbuilder", - pathFromRoot: "examples/09-ai/06-server-promptbuilder", - config: { - playground: true, - docs: false, - author: "yousefed", - tags: ["AI", "llm"], - dependencies: { + "ai": "^5.0.45", + "zustand": "^5.0.3" + } as any + }, + "title": "AI Integration with ClientSideTransport", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "The standard setup is to have BlockNote AI call your server, which then calls an LLM of your choice. In this example, we show how you can use the `ClientSideTransport` to make calls directly to your LLM provider.\n\nTo hide API keys of our LLM provider, we do still route calls through a proxy server using `fetchViaProxy` (this is optional)." + }, + { + "projectSlug": "server-promptbuilder", + "fullSlug": "ai/server-promptbuilder", + "pathFromRoot": "examples/09-ai/07-server-promptbuilder", + "config": { + "playground": true, + "docs": false, + "author": "yousefed", + "tags": [ + "AI", + "llm" + ], + "dependencies": { "@blocknote/xl-ai": "latest", "@mantine/core": "^7.17.3", - ai: "^5.0.45", - zustand: "^5.0.3", - } as any, - }, - title: "AI Integration with server LLM execution + promptbuilder", - group: { - pathFromRoot: "examples/09-ai", - slug: "ai", - }, - readme: - "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor.\n\nPrompt building is done on the server as well", - }, - ], + "ai": "^5.0.45", + "zustand": "^5.0.3" + } as any + }, + "title": "AI Integration with server LLM execution + promptbuilder", + "group": { + "pathFromRoot": "examples/09-ai", + "slug": "ai" + }, + "readme": "This example shows how to setup to add AI integration while handling the LLM calls (in this case, using the Vercel AI SDK) on your server, using a custom executor.\n\nPrompt building is done on the server as well" + } + ] }, "vanilla-js": { - pathFromRoot: "examples/vanilla-js", - slug: "vanilla-js", - projects: [ - { - projectSlug: "react-vanilla-custom-blocks", - fullSlug: "vanilla-js/react-vanilla-custom-blocks", - pathFromRoot: "examples/vanilla-js/react-vanilla-custom-blocks", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Blocks - Vanilla JS API", - group: { - pathFromRoot: "examples/vanilla-js", - slug: "vanilla-js", - }, - readme: "", - }, - { - projectSlug: "react-vanilla-custom-inline-content", - fullSlug: "vanilla-js/react-vanilla-custom-inline-content", - pathFromRoot: "examples/vanilla-js/react-vanilla-custom-inline-content", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Inline Content - Vanilla JS API", - group: { - pathFromRoot: "examples/vanilla-js", - slug: "vanilla-js", - }, - readme: "", - }, - { - projectSlug: "react-vanilla-custom-styles", - fullSlug: "vanilla-js/react-vanilla-custom-styles", - pathFromRoot: "examples/vanilla-js/react-vanilla-custom-styles", - config: { - playground: true, - docs: false, - author: "matthewlipski", - tags: [], - }, - title: "Custom Styles - Vanilla JS API", - group: { - pathFromRoot: "examples/vanilla-js", - slug: "vanilla-js", - }, - readme: "", - }, - ], - }, -}; + "pathFromRoot": "examples/vanilla-js", + "slug": "vanilla-js", + "projects": [ + { + "projectSlug": "react-vanilla-custom-blocks", + "fullSlug": "vanilla-js/react-vanilla-custom-blocks", + "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-blocks", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Blocks - Vanilla JS API", + "group": { + "pathFromRoot": "examples/vanilla-js", + "slug": "vanilla-js" + }, + "readme": "" + }, + { + "projectSlug": "react-vanilla-custom-inline-content", + "fullSlug": "vanilla-js/react-vanilla-custom-inline-content", + "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-inline-content", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Inline Content - Vanilla JS API", + "group": { + "pathFromRoot": "examples/vanilla-js", + "slug": "vanilla-js" + }, + "readme": "" + }, + { + "projectSlug": "react-vanilla-custom-styles", + "fullSlug": "vanilla-js/react-vanilla-custom-styles", + "pathFromRoot": "examples/vanilla-js/react-vanilla-custom-styles", + "config": { + "playground": true, + "docs": false, + "author": "matthewlipski", + "tags": [] + }, + "title": "Custom Styles - Vanilla JS API", + "group": { + "pathFromRoot": "examples/vanilla-js", + "slug": "vanilla-js" + }, + "readme": "" + } + ] + } +}; \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 384b1a0536..13b79105ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3117,9 +3117,6 @@ importers: examples/09-ai/01-minimal: dependencies: - '@ai-sdk/groq': - specifier: ^2.0.16 - version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3169,24 +3166,6 @@ importers: examples/09-ai/02-playground: dependencies: - '@ai-sdk/anthropic': - specifier: ^2.0.9 - version: 2.0.9(zod@3.25.76) - '@ai-sdk/google': - specifier: ^2.0.11 - version: 2.0.11(zod@3.25.76) - '@ai-sdk/groq': - specifier: ^2.0.16 - version: 2.0.16(zod@3.25.76) - '@ai-sdk/mistral': - specifier: ^2.0.12 - version: 2.0.12(zod@3.25.76) - '@ai-sdk/openai': - specifier: ^2.0.23 - version: 2.0.23(zod@3.25.76) - '@ai-sdk/openai-compatible': - specifier: ^1.0.13 - version: 1.0.13(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3236,12 +3215,6 @@ importers: examples/09-ai/03-custom-ai-menu-items: dependencies: - '@ai-sdk/groq': - specifier: ^2.0.16 - version: 2.0.16(zod@3.25.76) - '@ai-sdk/openai': - specifier: ^2.0.23 - version: 2.0.23(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3294,9 +3267,6 @@ importers: examples/09-ai/04-with-collaboration: dependencies: - '@ai-sdk/groq': - specifier: ^2.0.16 - version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3352,9 +3322,6 @@ importers: examples/09-ai/05-manual-execution: dependencies: - '@ai-sdk/groq': - specifier: ^2.0.16 - version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit @@ -3408,8 +3375,11 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.15.2)(lightningcss@1.30.1)(terser@5.44.0) - examples/09-ai/06-client-transport: + examples/09-ai/06-client-side-transport: dependencies: + '@ai-sdk/groq': + specifier: ^2.0.16 + version: 2.0.16(zod@3.25.76) '@blocknote/ariakit': specifier: latest version: link:../../../packages/ariakit From 54a4493244811b16875396a802620ddcf248bf29 Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 25 Sep 2025 11:32:11 +0200 Subject: [PATCH 59/68] toolDefinitions --- .../src/routes/model-playground/index.ts | 13 ++--- .../src/routes/objectGeneration.ts | 23 +++++---- packages/xl-ai-server/src/routes/regular.ts | 13 ++--- .../src/routes/serverPromptbuilder.ts | 14 ++---- .../api/aiRequest/defaultAIRequestSender.ts | 8 +++- packages/xl-ai/src/index.ts | 2 +- .../streamTool/toolDefinitionsToToolSet.ts | 24 ++++++++++ .../clientside/ClientSideTransport.ts | 47 ++++++++----------- 8 files changed, 76 insertions(+), 68 deletions(-) create mode 100644 packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts diff --git a/packages/xl-ai-server/src/routes/model-playground/index.ts b/packages/xl-ai-server/src/routes/model-playground/index.ts index 00a61d1e22..d4ee2acfa3 100644 --- a/packages/xl-ai-server/src/routes/model-playground/index.ts +++ b/packages/xl-ai-server/src/routes/model-playground/index.ts @@ -4,7 +4,8 @@ import { createGroq } from "@ai-sdk/groq"; import { createMistral } from "@ai-sdk/mistral"; import { createOpenAI } from "@ai-sdk/openai"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; -import { convertToModelMessages, jsonSchema, streamText, tool } from "ai"; +import { toolDefinitionsToToolSet } from "@blocknote/xl-ai"; +import { convertToModelMessages, streamText } from "ai"; import { Hono } from "hono"; export const modelPlaygroundRoute = new Hono(); @@ -15,7 +16,7 @@ export const modelPlaygroundRoute = new Hono(); * based on which we use the corresponding AI SDK model */ modelPlaygroundRoute.post("/streamText", async (c) => { - const { messages, streamTools, model: modelString } = await c.req.json(); + const { messages, toolDefinitions, model: modelString } = await c.req.json(); const model = getModel(modelString); @@ -26,13 +27,7 @@ modelPlaygroundRoute.post("/streamText", async (c) => { const result = streamText({ model, messages: convertToModelMessages(messages), - tools: { - applyDocumentOperations: tool({ - name: "applyDocumentOperations", // TODO - inputSchema: jsonSchema(streamTools), - outputSchema: jsonSchema({ type: "object" }), - }), - }, + tools: toolDefinitionsToToolSet(toolDefinitions), toolChoice: "required", }); diff --git a/packages/xl-ai-server/src/routes/objectGeneration.ts b/packages/xl-ai-server/src/routes/objectGeneration.ts index 168276736a..e909dfff25 100644 --- a/packages/xl-ai-server/src/routes/objectGeneration.ts +++ b/packages/xl-ai-server/src/routes/objectGeneration.ts @@ -26,8 +26,12 @@ const model = createOpenAI({ })("gpt-4o"); objectGenerationRoute.post("/streamObject", async (c) => { - const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(streamTools); + const { messages, toolDefinitions } = await c.req.json(); + + // (we assume there is only one tool definition passed and that should be used for object generation) + const toolName = Object.keys(toolDefinitions)[0]; + + const schema = jsonSchema(toolDefinitions[toolName].inputSchema); const result = streamObject({ model, messages: convertToModelMessages(messages), @@ -37,15 +41,19 @@ objectGenerationRoute.post("/streamObject", async (c) => { const stream = partialObjectStreamAsToolCallInUIMessageStream( result.fullStream, - "applyDocumentOperations", // TODO, hardcoded + toolName, ); return createUIMessageStreamResponse({ stream }); }); objectGenerationRoute.post("/generateObject", async (c) => { - const { messages, streamTools } = await c.req.json(); - const schema = jsonSchema(streamTools); + const { messages, toolDefinitions } = await c.req.json(); + + // (we assume there is only one tool definition passed and that should be used for object generation) + const toolName = Object.keys(toolDefinitions)[0]; + + const schema = jsonSchema(toolDefinitions[toolName].inputSchema); const result = await generateObject({ model, @@ -54,10 +62,7 @@ objectGenerationRoute.post("/generateObject", async (c) => { schema, }); - const stream = objectAsToolCallInUIMessageStream( - result.object, - "applyDocumentOperations", // TODO, hardcoded - ); + const stream = objectAsToolCallInUIMessageStream(result.object, toolName); return createUIMessageStreamResponse({ stream }); }); diff --git a/packages/xl-ai-server/src/routes/regular.ts b/packages/xl-ai-server/src/routes/regular.ts index 346d3976f5..51b1383f97 100644 --- a/packages/xl-ai-server/src/routes/regular.ts +++ b/packages/xl-ai-server/src/routes/regular.ts @@ -1,5 +1,6 @@ import { createOpenAI } from "@ai-sdk/openai"; -import { convertToModelMessages, jsonSchema, streamText, tool } from "ai"; +import { toolDefinitionsToToolSet } from "@blocknote/xl-ai"; +import { convertToModelMessages, streamText } from "ai"; import { Hono } from "hono"; export const regularRoute = new Hono(); @@ -19,18 +20,12 @@ const model = createOpenAI({ // Use `streamText` to stream text responses from the LLM regularRoute.post("/streamText", async (c) => { - const { messages, streamTools } = await c.req.json(); + const { messages, toolDefinitions } = await c.req.json(); const result = streamText({ model, messages: convertToModelMessages(messages), - tools: { - applyDocumentOperations: tool({ - name: "applyDocumentOperations", // TODO - inputSchema: jsonSchema(streamTools), - outputSchema: jsonSchema({ type: "object" }), - }), - }, + tools: toolDefinitionsToToolSet(toolDefinitions), toolChoice: "required", }); diff --git a/packages/xl-ai-server/src/routes/serverPromptbuilder.ts b/packages/xl-ai-server/src/routes/serverPromptbuilder.ts index 775e5c524b..b4112dcc52 100644 --- a/packages/xl-ai-server/src/routes/serverPromptbuilder.ts +++ b/packages/xl-ai-server/src/routes/serverPromptbuilder.ts @@ -1,12 +1,10 @@ import { createOpenAI } from "@ai-sdk/openai"; -import { llmFormats } from "@blocknote/xl-ai"; +import { llmFormats, toolDefinitionsToToolSet } from "@blocknote/xl-ai"; import { convertToModelMessages, createIdGenerator, isToolOrDynamicToolUIPart, - jsonSchema, streamText, - tool, UIMessage, UIMessagePart, validateUIMessages, @@ -47,15 +45,9 @@ async function saveChat({ // follows this example: // https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence#sending-only-the-last-message serverPromptbuilderRoute.post("/streamText", async (c) => { - const { id, promptData, streamTools, lastToolParts } = await c.req.json(); + const { id, promptData, toolDefinitions, lastToolParts } = await c.req.json(); - const tools = { - applyDocumentOperations: tool({ - name: "applyDocumentOperations", - inputSchema: jsonSchema(streamTools), - outputSchema: jsonSchema({ type: "object" }), - }), - }; + const tools = toolDefinitionsToToolSet(toolDefinitions); // load the previous messages from the server: const messages = await loadChat(id); diff --git a/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts b/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts index a5260044ec..f8ab2091ce 100644 --- a/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts +++ b/packages/xl-ai/src/api/aiRequest/defaultAIRequestSender.ts @@ -24,7 +24,13 @@ export function defaultAIRequestSender( ...options, body: { ...(options?.body ?? {}), - streamTools: createStreamToolsArraySchema(aiRequest.streamTools), + toolDefinitions: { + applyDocumentOperations: { + name: "applyDocumentOperations", + inputSchema: createStreamToolsArraySchema(aiRequest.streamTools), + outputSchema: { type: "object" }, + }, + }, }, // we pass the promptData as metadata // so the transport can decide whether or not to submit this to the server diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts index ba069f66a3..1d762a6b29 100644 --- a/packages/xl-ai/src/index.ts +++ b/packages/xl-ai/src/index.ts @@ -17,7 +17,7 @@ export * from "./api/index.js"; // TODO: organize these exports: export * from "./streamTool/jsonSchema.js"; export * from "./streamTool/StreamToolExecutor.js"; - +export * from "./streamTool/toolDefinitionsToToolSet.js"; export * from "./streamTool/vercelAiSdk/clientside/ClientSideTransport.js"; export * from "./streamTool/vercelAiSdk/util/partialObjectStreamUtil.js"; export * from "./streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.js"; diff --git a/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts b/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts new file mode 100644 index 0000000000..8c7b217fa1 --- /dev/null +++ b/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts @@ -0,0 +1,24 @@ +import { jsonSchema, JSONSchema7, tool } from "ai"; + +export function toolDefinitionsToToolSet( + toolDefinitions: Record< + string, + { + name: string; + description?: string; + inputSchema: JSONSchema7; + outputSchema: JSONSchema7; + } + >, +) { + return Object.fromEntries( + Object.entries(toolDefinitions).map(([name, definition]) => [ + name, + tool({ + ...definition, + inputSchema: jsonSchema(definition.inputSchema), + outputSchema: jsonSchema(definition.outputSchema), + }), + ]), + ); +} diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts index 83f5c60b9b..72b3b388e7 100644 --- a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts +++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts @@ -1,16 +1,16 @@ import { ChatTransport, LanguageModel, + ToolSet, UIMessage, UIMessageChunk, convertToModelMessages, generateObject, generateText, - jsonSchema, streamObject, streamText, - tool, } from "ai"; +import { toolDefinitionsToToolSet } from "../../../streamTool/toolDefinitionsToToolSet.js"; import { objectAsToolCallInUIMessageStream, partialObjectStreamAsToolCallInUIMessageStream, @@ -86,17 +86,16 @@ export class ClientSideTransport * * This is the non-streaming version. */ - protected async generateObject( - messages: UIMessage[], - streamToolJSONSchema: any, - ) { + protected async generateObject(messages: UIMessage[], tools: ToolSet) { const { model, _additionalOptions } = this.opts; if (typeof model === "string") { throw new Error("model must be a LanguageModelV2"); } - const schema = jsonSchema(streamToolJSONSchema); + // (we assume there is only one tool definition passed and that should be used for object generation) + const toolName = Object.keys(tools)[0]; + const schema = tools[toolName].inputSchema; const ret = await generateObject({ output: "object" as const, @@ -108,10 +107,7 @@ export class ClientSideTransport ...((_additionalOptions ?? {}) as any), }); - return objectAsToolCallInUIMessageStream( - ret.object, - "applyDocumentOperations", - ); + return objectAsToolCallInUIMessageStream(ret.object, toolName); } /** @@ -119,17 +115,16 @@ export class ClientSideTransport * * This is the streaming version. */ - protected async streamObject( - messages: UIMessage[], - streamToolJSONSchema: any, - ) { + protected async streamObject(messages: UIMessage[], tools: ToolSet) { const { model, _additionalOptions } = this.opts; if (typeof model === "string") { throw new Error("model must be a LanguageModelV2"); } - const schema = jsonSchema(streamToolJSONSchema); + // (we assume there is only one tool definition passed and that should be used for object generation) + const toolName = Object.keys(tools)[0]; + const schema = tools[toolName].inputSchema; const ret = streamObject({ output: "object" as const, @@ -144,7 +139,7 @@ export class ClientSideTransport // Transform the partial object stream to a data stream format return partialObjectStreamAsToolCallInUIMessageStream( ret.fullStream, - "applyDocumentOperations", + toolName, ); } @@ -153,18 +148,13 @@ export class ClientSideTransport * * This is the streaming version. */ - protected async streamText(messages: UIMessage[], streamToolJSONSchema: any) { + protected async streamText(messages: UIMessage[], tools: ToolSet) { const { model, _additionalOptions } = this.opts; const ret = streamText({ model, messages: convertToModelMessages(messages), - tools: { - applyDocumentOperations: tool({ - name: "applyDocumentOperations", - inputSchema: jsonSchema(streamToolJSONSchema), - }), - }, + tools, toolChoice: "required", // extra options for streamObject ...((_additionalOptions ?? {}) as any), @@ -182,13 +172,14 @@ export class ClientSideTransport ReadableStream > { const stream = this.opts.stream ?? true; - const streamTools = (body as any).streamTools; + const toolDefinitions = (body as any).toolDefinitions; + const tools = toolDefinitionsToToolSet(toolDefinitions); if (this.opts.objectGeneration) { if (stream) { - return this.streamObject(messages, streamTools); + return this.streamObject(messages, tools); } else { - return this.generateObject(messages, streamTools); + return this.generateObject(messages, tools); } } @@ -198,7 +189,7 @@ export class ClientSideTransport // throw new Error("fake network error"); // } - const ret = await this.streamText(messages, streamTools); + const ret = await this.streamText(messages, tools); // this can be used to simulate network errors while streaming // let i = 0; From e6542f5e3394852be604e0a3930feaf740d35e4a Mon Sep 17 00:00:00 2001 From: yousefed Date: Thu, 25 Sep 2025 13:06:19 +0200 Subject: [PATCH 60/68] first docs fixes --- docs/content/docs/ai/getting-started.mdx | 106 ----- docs/content/docs/ai/index.mdx | 63 --- docs/content/docs/ai/meta.json | 4 - docs/content/docs/ai/reference.mdx | 376 ------------------ .../docs/features/ai/backend-integration.mdx | 106 +++++ .../docs/features/ai/custom-commands.mdx | 18 +- .../docs/features/ai/getting-started.mdx | 65 +-- docs/content/docs/features/ai/index.mdx | 1 + docs/content/docs/features/ai/meta.json | 7 +- packages/xl-ai/docs.md | 13 - 10 files changed, 160 insertions(+), 599 deletions(-) delete mode 100644 docs/content/docs/ai/getting-started.mdx delete mode 100644 docs/content/docs/ai/index.mdx delete mode 100644 docs/content/docs/ai/meta.json delete mode 100644 docs/content/docs/ai/reference.mdx create mode 100644 docs/content/docs/features/ai/backend-integration.mdx delete mode 100644 packages/xl-ai/docs.md diff --git a/docs/content/docs/ai/getting-started.mdx b/docs/content/docs/ai/getting-started.mdx deleted file mode 100644 index 3a78811210..0000000000 --- a/docs/content/docs/ai/getting-started.mdx +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Getting Started with BlockNote AI -description: Add AI functionality to your BlockNote rich text editor -imageTitle: BlockNote AI ---- - -This guide walks you through the steps to add AI functionality to your BlockNote rich text editor. - -First, install the `@blocknote/xl-ai` package: - -```bash -npm install @blocknote/xl-ai -``` - -## Creating a Model - -BlockNote AI uses the the [AI SDK](https://ai-sdk.dev/docs/foundations/overview) to standardize integrating artificial intelligence (AI) models across [supported providers](https://ai-sdk.dev/docs/foundations/providers-and-models). - -As a first step, you'll need to register a new model with the AI SDK. For example, for Llama hosted on Groq: - -```bash -npm install @ai-sdk/groq -``` - -```ts -import { createGroq } from "@ai-sdk/groq"; - -const provider = createGroq({ - apiKey: "YOUR_GROQ_API_KEY", -}); - -const model = provider("llama-3.3-70b-versatile"); -``` - - - Note that this setup directly calls the provider from the client, and exposes - your API keys on the client. For Production scenarios, a more common approach - is to handle authentication on your own server and proxy requests to a - provider. See our [Demo AI - Server](https://github.com/TypeCellOS/BlockNote/tree/main/packages/xl-ai-server) - for a Node.js example or check the AI SDK best practices. - - -## Setting up the editor - -Now, you can create the editor with the AI Extension enabled: - -```ts -import { createBlockNoteEditor } from "@blocknote/core"; -import { BlockNoteAIExtension } from "@blocknote/xl-ai"; -import { en } from "@blocknote/core/locales"; -import { en as aiEn } from "@blocknote/xl-ai/locales"; -import { createAIExtension } from "@blocknote/xl-ai"; -import "@blocknote/xl-ai/style.css"; // add the AI stylesheet - -const editor = createBlockNoteEditor({ - dictionary: { - ...en, - ai: aiEn, // add default translations for the AI extension - }, - extensions: [ - createAIExtension({ - model, - }), - ], - // ... other editor options -}); -``` - -See the [API Reference](/docs/features/ai/reference) for more information on the `createAIExtension` method. - -## Adding AI UI elements - -Now, the only thing left to do is to customize the UI elements of your editor. -We want to: - -- add an AI button to the formatting toolbar (shown when selecting text) -- add an AI option to the slash menu (shown when typing a `/`) - -We do this by disabling the default FormattingToolbar and SuggestionMenu and adding our own. See [Changing UI Elements](/docs/react/components) for more information. - -```tsx - - {/* Add the AI Command menu to the editor */} - - - {/* Create you own Formatting Toolbar with an AI button, - (see the full example code below) */} - - - {/* Create you own SlashMenu with an AI option, - (see the full example code below) */} - - -``` - -## Full Example - -See the full example code and live demo. Select some text and click the AI (stars) button, or type `/ai` anywhere in the editor to access AI functionality. - - diff --git a/docs/content/docs/ai/index.mdx b/docs/content/docs/ai/index.mdx deleted file mode 100644 index 7a500c5ea3..0000000000 --- a/docs/content/docs/ai/index.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: AI Rich Text Editing -description: Add AI functionality to your BlockNote rich text editor ---- - -With BlockNote AI, you can add AI functionality to your rich text editor. -Users can work with an AI agent to edit, write and format their documents. - -